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
Community Support Team
Community Support Team

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

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

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

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

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

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

Damo_R
Level: Powered On

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

Hi, 

 

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 170 members 4,698 guests
Please welcome our newest community members: