cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Import Data from excel attachment in email to Sharepoint list to Powerapps

 

How can you create a flow to update a sharepoint list, daily, with information from an excel workbook that is sent to me as an attachment in an outlook email?

 

In other words, I have created an app in Powerapps to display my sales reps' goals and tracking numbers. It allows them to see their sales numbers and rankings, in a user friendly format, on their phones/ tablets. The app is linked to and populated by an excel table that I manually update every morning on my Onedrive. The information I use to update the table with comes from an excel workbook that is sent to me as attachment on an email every morning around 3 am. Although it is not that time consuming to copy and paste, I would like to automate this process, if possible.

So the flow would look like this -

 

I get an email at 3 am with an excel attachment. I need the information in the excel attachment imported/added to a Sharepoint list that will be linked to Powerapps.

 

Can someone help?

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Currently, we could not get excel table data from the excel attachment of an email directly in Microsoft Flow. You could consider take a try to save the Excel attachment to a OneDrive folder firstly, then get excel table data from the Excel file saved in your OneDrive folder.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a Recurrence trigger, Interval set to 1 and Frequency set to Day, At these hours field set to 3.
  • Add a "Get emails" action, Include Attachments field set to Yes, Top field set to 1.
  • Add a "Apply to each" action, input parameter set to output of "Get emails" action.
  • Within "Apply to each" action, Add a "Apply to each 2" action, input parameter set to following formula:
item()?['Attachments']
  • Within "Apply to each 2" action, add a Condition, click "Edit in advanced mode", type the following formula:
@contains(items('Apply_to_each_2')?['Name'], '.xlsx')

Within "If/yes" branch of Condition, add a "Create file" action of OneDrive connector, specify Folder Path, File Name field set to Name dynamic content of "Get emails" action, File Content field set to Content dynamic content of "Get emails" action.

 

Add a "Get rows" action, File name field set to Id dynamic content of "Create file" action, Table name set to custom value Table1.

 

Add a "Apply to each 3" action, input parameter set to output of "Get rows" action. Within "Apply to each 3" action, add a "Create item" action of SharePoint connector, specify Site Address and List Name. Title field set to following formula:

item()?['__PowerAppsId__']

TaskName field set to following formula:

item()?['TaskName']

Executor field set to following formula:

item()?['Executor']

Due Date field set to following formula:

item()?['Due_x0020_Date']

Note: TaskName, Executor and Due Date column are columns in my Excel table, you could use following formula to get the column value within your Excel table:

item()?['ColumnName']

If there is a space within column name, please use '_x0020_' instead of the space within above formula.

 

 

Image reference:15.JPG

 

16.JPG

 

17.JPG

 

The flow works successfully as below:18.JPG

 

19.JPG

 

 

More details about using expression in flow actions, please check the following article:

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you, Kris. Also, thank you for your quick response. I will try this and update you once I have it complete. 

Anonymous
Not applicable

Unfortunately I am getting an "ActionFailed. An action failed. No dependent actions succeeded." error on the Apply to each action

Damo_R
Frequent Visitor

Hi, 

 

Did you manage to get this to work as i have the exact same issue?

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,453)