cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MW630
Frequent Visitor

Flow hangs trying to read Excel Document on OneDrive

I'm trying to create a flow that accomplishes the following:

 

1) Users e-mail a .xlsx to a monitored e-mail address. They will use a template worksheet that has a data table so the table name will be consistent with every submission.

2) When a new e-mail arrives, if there is an attachment with "Confirmation" in the name, that attachment is copied to a OneDrive for Business Folder.

3) A "when a new file is created" trigger is monitoring for when the file is created in OneDrive and then Get Rows is used to read the file and enter the contents of that attachment to a SharePoint List.

4) After the data from the .xlsx is loaded to the SharePoint list, the file is duplicated in an archive folder and the original is deleted. 

 

The issue is the flow will work very randomly.  It keeps get hung on the "When a file is created" step. See the second screenshot below, I deleted the file after it was running for over 45 minutes to capture the error.  We're only dealing with 2 records in the spreadsheet - so not a ton of data.

 

What should I do to avoid the issue it's having getting stuck on "When A File Is Created"?

 

1) Flow layout:

Flow 1.jpg

 

2) Flow stuck on file creation - it shows an error on apply to each, but that happens when I deleted the file from OneDrive:

Flow 1.jpg

4 REPLIES 4
v-yamao-msft
Community Support
Community Support

Hi @MW630,

 

Thanks for giving the detailed scenario on your flow. According to your description, I have made the following flow for your reference.

 

Please just remove the trigger When a file is created from your flow. After the action Create file, add the action Create item directly.

 

As you mentioned that all the attachments have the same table name, do they have the same column names?

 

If yes, then in the action Create item, use the following functions to get items:

For Title: item()?['name']

For date: item()?['date']

 

The items will be created successfully in the SharePoint list.

1.PNG2.PNG

 

 

Please try it on your side and feel free post back if you need more help.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yamao-msft Thank you for the suggestions.  

 

I am receiving the following error when it tries to create the SharePoint List item.  Any suggestions?

 

  "status"400,
  "message""To add an item to a document library, use SPFileCollection.Add()\r\nclientRequestId: 26368ef2-88ac-4cdc-b392-a3ce59ecbbc6\r\nserviceRequestId: e02c899e-a097-6000-ee8a-3eaf83c71d38"

Hi @MW630,

 

Could you share a screenshot of your current flow?

 

In the action Create item, are you trying to populate value into a library but not a list?

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GabrielStJohn
Community Champion
Community Champion

Hey, @MW630!

 

Thank you for posting on the Flow Community Forum! It appears as though @v-yamao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

 

Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Kudoed Authors
Users online (6,321)