Last week, I worked on a Power Automate scenario where I needed to export the TS MGMT Meeting SharePoint list to Excel and email it to the manager. The goal was to export all SharePoint items to Excel and then send an email with the Excel file as an attachment.
In this tutorial, I will explain how to export SharePoint List to Excel and send an email using Power Automate.
Export SharePoint List to Excel and Send an Email Using Power Automate
Before creating the flow, we need to create a SharePoint list. Here, I created a SharePoint list with the following columns and data types:
| Column | Data Types |
|---|---|
| Title | Single line of text |
| Status | Choice |
| Initial Email Date | Date and time |
| 1st Reminder Date | Date and time |
| Category | Choice |
| Due Date | Date and time |
| Email Addressees | Singel line of text |

Also, create a blank Excel file in your SharePoint document library, as shown below.

Now follow the below steps:
1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

2. Now choose a Get file content action for SharePoint Connector and configure the required parameters:
- Site Address: Select the SharePoint site address from the dropdown where we create the blank Excel file.
- File Identifier: Choose the Excel file we created before.

3. Then save the flow and test it. After the flow runs, copy the body of the “Get file content” action.

4. Then, edit the flow and add a Compose action. In the input field of the Compose action, paste the body of the Get file content action.

After that, delete the Get file content action and the blank Excel file from your document library.
5. Next, add a Get items action to retrieve all items present in the SharePoint list and provide the following parameters:
- Site Address: Select the SharePoint site address.
- List Name: Select the name of the SharePoint list you want to retrieve items from.

6. Now, add an action to store Excel files in a SharePoint library. Click the + icon to add the Create file action (under the SharePoint connector) and provide the required parameters:
- Site Address: Select the SharePoint site address from the dropdown menu where you store all your Excel files.
- Folder Path: Select the folder path.
- File Name: Provide the Excel file name with the .xlsx extension. Here, use the SharePoint ID column from dynamic content.
- File Content: Use the dynamic content Output from the Compose action.

7. Now, let’s create an Excel table. Click the + icon to add the Create table action (under the Excel Online (Business) connector) and provide the following parameters:
- Location: Select the SharePoint site address from the dropdown menu.
- Document Library: Select the document library where the Excel file is stored.
- File: Provide the dynamic content from the Create file action, using body/Id.
- Table Range: Specify the range based on the number of columns you have. For example, if you have seven columns, use A1:G1. Adjust this range according to your columns.
- Table Name: Enter a name for the table.
- Column Names: List all the column names you want to include in the table.

8. Now, let’s add a row to the table. Click the + icon to add the Add a row into a table action (under the Excel Online (Business) connector) and provide the required parameters:
- Location: Select the SharePoint site.
- Document Library: Choose the Documents folder.
- File: Provide the dynamic content from the Create file action, using body/Id.
- Table: Select the table name from the dynamic content.
- Row: Provide the values for each column in the table. Map the dynamic content for each column as needed.
| Column Name | Dynamic Content |
|---|---|
| Title | items()?[‘Title’] |
| Status | item()?[‘Status’]?[‘Value’] |
| Initial Email Date | item()?[‘InitialEmailDate’] |
| 1st Reminder Date | item()?[‘1stReminderDate’] |
| Category | item()?[‘Category’]?[‘Value’] |
| Due Date | iitem()?[‘DueDate’] |
| Email Addressees | item()?[‘EmailAddressees’] |

9. Next, add a delay action and provide the count as 1 and Unit as Minute.

10. Now add a Get file content action for SharePoint Connector and configure the required parameters:
- Site Address: Select the SharePoint site address from the dropdown.
- File Identifier: Provide the dynamic content from the Create file action, using body/Id.

11. Now, add a Send an email action to send the Excel file. To do this, add the Send an email action with the following parameters:
- To: Enter the recipient’s email address (e.g., the manager’s email).
- Subject: Provide a subject for the email.
- Body: Write the body content of the email, including any message or instructions.
- Attachments: Attach the Excel file by using the dynamic content File Content from the Create file action.

Run the Flow to Export the SharePoint List to Excel and Send an Email
Now, it’s time to save the flow. Click on Test -> Select Manually -> click Test. After the flow runs successfully, go to the SharePoint library, and you will see that the file has been successfully created.

Also, you can check Outlook emails; the email comes with an Excel attachment.

In this tutorial, I explained how to export a SharePoint list to Excel and send it via email using Power Automate. We also covered how to create a table dynamically, define columns, and add rows in Excel.
Related Power Automate tutorials:
- Export Power BI Report to Excel using Power Automate
- Filter Excel Files Based On Date Using Power Automate
- Remove the Top Few Lines of an Excel File Using Power Automate
- Delete All Items in the SharePoint List Using Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.
Says this is not a valid expression
outputs(‘A1_Notation_Mapping'[sub(length(outputs(‘Array_of_col’)),1)]
Same for me.
The parentheses and brackets are messed up. Try this:
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
Receiving an error that is is not a valid expresssion:
outputs(‘A1_Notation_Mapping'[sub(length(outputs(‘Array_of_col’)),1)])
This is no longer an expression:
outputs(‘A1_Notation_Mapping'[sub(length(outputs(‘Array_of_col’)),1)])
Was anyone able to get this to work still?
The parentheses and brackets are messed up. Try this:
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
I have not.
Correct to include a valid reference to ‘Array_of_col’ for the input parameter(s) of action ‘Create_table’.
Correct to include a valid reference to ‘A1_Notation_Mapping’ for the input parameter(s) of action ‘Create_table’.
I get both of those errors in flow checker.
Hello,
this is not working for me either!
I keep getting ‘The expression is invalid.’ when inserting outputs(‘A1_Notation_Mapping'[sub(length(outputs(‘Array_of_col’)),1)]).
@Bijay Kumar any tips please??
Same for me
One question, how can I bring more than 100 items in Get Items, since it only brings 100 and if I have more than 100 records it does not generate them in the excel table. Thanks
You can increase the threshold by clicking on setting of the get items connector.
I keep getting ‘The expression is invalid.’ when inserting outputs(‘A1_Notation_Mapping'[sub(length(outputs(‘Array_of_col’)),1)]).
@Bijay Kumar any tips please??
Unfortunately both versions of the
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)] and outputs(‘A1_Notation_Mapping'[sub(length(outputs(‘Array_of_col’)),1)]) are giving me the error, has anyone been able to find a working solution?
You have to change the name of the flows as show in the images below for example when you do “Compose” PowerAutomate will just name it Compose, Compose1, Compose2 so on. You have to click the 3 polka dots, click rename and rename it to “A1 Notation Mapping” or “Array of col” respectively. Also correct formula to use is this outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
The single quotes aren’t being recognized because it’s a different font. Fix the quotes or copy paste the one in this comment, up to you.
I am still receiving the Invalid expression error.
Chris it worked for me but when I pasted the formula I had to correct the quotations, so basically wipe out the quotations around A1 Notation Mapping and retype them ‘. Also, I didnt have underscores.
This is what I used, but remember, delete the quotations and retype them because when you copy paste it reformats them incorrectly: outputs(‘A1 Notation Mapping’)[sub(length(outputs(‘Array of col’)),1)]
this worked for me. I think its best you write the code in, instead of copy and paste.
Changing the single quoted worked for me! Thanks!
Sorry correction, keep the underscores, I just got a warning and I had to add them and now it works! so it should be A1_Notation_Mapping and Array_of_col
Hello,
I have a problem in this Step “10: Add rows to the excel table”.
I can’t provide the name from the dynamic content (I don’t have expression field) and i don’t have Row field.
Can you help me?
Thanks
I ran into the same issue. Changing that filed to “Dynamic Content” is what worked for me.
You have to press on : “Enter custom value” first and then you can add it.
I am having a issue with this expression when using the create a table.
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
It is returning this error.
The argument is invalid or missing or has an incorrect format.
clientRequestId: 556c0553-59e4-4184-805c-79ea66f5b408
serviceRequestId: 6d499c8d-354e-41a1-b7b2-f0d99560e3c9
Also the value that is being shown in the table range is ($A1:$N)
So I think that the outputs formula has something wrong in it. Any help would be much appreciated.
I am also getting the same error. Any assistance with this would be greatly appreciated!
Did somebody find a solution? I am also stuck here … the rownumber seems to be not working out well and flow is therefore stuck!
*TIPS ON HOW TO FIX*
I’m including feedback from other people, so I do not take full credit.
1. Make sure you have renamed the step after “Create CSV table” and before “Get file content” to “Array of col”.
2. Make sure you have renamed the step after “Create file” and before “Create table” to “A1 Notation Mapping”.
3. In the table range, make sure you type “$A1:$” first.
4. When you paste the formula, re-enter the ‘ symbols.
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
Flow run failed in the “Add a row ito a table” step , the error message is : “unsupported Media Type , the request entity’s media typ ‘text/plain’is not supported for this resource” and how to fixed ? thanks
Had the same issue. When the dynamic choices come up, make sure to select the “Output” option under the “Select” category, meaning that it is taking the output from the “Select” step at the beginning as opposed to the output of the CSV. To be honest, I’m not certain that’s overall correct, but it made the flow run successfully.
Please give the valid fx
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
I’m having a different problem to most, I have changed the problem expression as others have suggested (but also removed the spaces for ease) but when I run the flow I get this error:
“Unable to process template language expressions in action ‘Create_table’ inputs at line ‘0’ and column ‘0’: ‘The template language expression ‘outputs(‘A1NotationMapping’)[sub(length(outputs(‘Arrayofcol’)),1)]’ cannot be evaluated because property ‘7’ cannot be selected. Property selection is not supported on values of type ‘String’.”
Anyone any ideas?
you need to edit your commands, e.g. from (‘A1_Notation_Mapping) to (‘A1NotationMapping’).
or simply change the element names.
Hi Bijay,
You may be able to really speed up the export by using this Excel batch update & create method. It may even help make this functional as a real-time export of large files when a user presses a button somewhere.
https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Create-Update-and-Upsert/td-p/1624706
Question: Why is my excel missing data for a few columns?
Hi All, this is a great tool and working for me great after reading the comments in the email. Unfortunately, when I receive the email the file states it could be corrupted. Any ideas or thoughts to fix this?
This is great! Thank you!
Different problem from most- If I run the aforementioned flow steps without the “Apply to Each” function, the document and table is created. However, I run into a problem in the “Add a row into a table” function. After selecting File= Id, I am presented with the following error in the Table section:
Could not retrieve values. Value segment type ‘literal’ expression ” invalid. Only literal segment types may be used.
Copy Error
Does anyone know what the issue may be? As mentioned, all previous steps work until trying to create this function.
I ran into the same issue. Changing that filed to “Dynamic Content” is what worked for me.
I’m stuck on the 2nd step. I changed the Query filter to match my column header(Active Employye) and data(Yes) but I keep receiving an error:
The expression “Active Employee eq ‘Yes'” is not valid. Creating query failed.
clientRequestId: 30c6a3ab-63ef-4e40-a67e-e430bd9730bc
serviceRequestId: 30c6a3ab-63ef-4e40-a67e-e430bd9730bc
Any Suggestions?
Hi,
i have 2 issues
first beeing Status EQ ‘DELIVERED’ creating an error saying status does not exist. removing the filter seems to have it working tru.
second, beeing that darn “apply to each” issue, for some reason its stops saying “A value must be provided for item.
clientRequestId: 85cb1274-1e0d-4496-ab50-4269d9a6381b”
{
“message”: “A value must be provided for item.rnclientRequestId: 85cb1274-1e0d-4496-ab50-4269d9a6381b”,
“status”: 400,
“error”: {
“message”: “A value must be provided for item.”
},
“source”: “excelonline-eus.azconn-eus-002.p.azurewebsites.net”
}
i have triple checked my output to be the correct one as well as id, name, current item.
even tried tweeking Select nothing come along the issue havent manage to get 1 complete run yet so far.
thanks for all the help.
Did you get it to work ? I am getting the same error.
“A value must be provided for item.
clientRequestId: bf609545-bd99-4cdf-9bda-449fadb726a9”
Hi All, the ‘Add row into table’ has reported a Unsupported Media Type under Apply to Each.
Error: Action ‘Add_a_row_into_a_table’ failed
Error Details: The request entity’s media type ‘text/plain’ is not supported for this resource.
Any ideas.
Thanks
Error Details
Start time
Oct 12, 06:59 PM (9 seconds ago9 sec ago)
Duration
00:00:05
Error
Action ‘Create_table’ failed
Error Details
The argument is invalid or missing or has an incorrect format.
clientRequestId: 2d6010ca-7e82-499c-8902-855c17718a63
serviceRequestId: 1bbdd434-fa8a-4c2b-bd66-c09336137eb0;041f962a-6af8-4532-9383-448948b7272a
I have an issue in create a table please guide me
$A1:$ outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
first(split(body(‘Create_CSV_table’),decodeUriComponent(‘%0D%0A’)))
but not working
Hi Bijay,
good sharing…thanks a lot.
yet while i follow the steps, come out with error:
Error
Action ‘Create_table’ failed
Error Details
The resource could not be found.
clientRequestId: aa025608-6180-491d-8963-fef8473a048b
serviceRequestId: 09892b2c-d63b-4332-96b6-299179bd3bfe
do you have any idea on this? thanks
I think solution which is present here ….. it is one big s.h.i.t
outputs(‘A1_Notation_Mapping’)[sub(length(outputs(‘Array_of_col’)),1)]
Flow has no errors but is failing at create table stage. Managed to correct the mistakes in the expression with help from this thread but no more.
getting a value must be added in add a row into table action
getting error in add row into a table action stating that a value must be added
anyone getting this error:
The request is forbidden by Graph API. Error code is ‘AccessDenied’. Error message is ‘Could not obtain a WAC access token.’.
clientRequestId: 7d8d0012-0318-4461-84e4-4145f142111f
serviceRequestId: cfb00024-2d7d-4323-8796-82385e3814d9
Hi,
Can we also do this for a document library? I am trying to mimic the export to excel function using power automate for a document library. I am not sure which connector to use as Get items only works for Lists. Any suggestions would be appreciated. thanks
Create CSV table error:
BadRequest. The ‘from’ property value in the ‘table’ action inputs is of type ‘String’. The value must be of type ‘Array