cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Sharepoint Copy File not working correctly

I use a Power App to allow event managers to record information about their events to a SharePoint list.  Amending data on the list runs a Power Automate flow.  Very simple flow:

1) Checks a column in the list to see if the event is ready to be reported and if not terminates the flow as successful.  Otherwise

2) A number of compose steps calculate some summary data and convert dates and money amounts to correct format

3) Email built from a variety of information from the original list and the compose outputs and sent to appropriate mailing list

 

So far, so good.  This all works fine.  BUT the Directors used to get a nice, colourful pdf of the data which was exported from a very complex Excel spreadsheet.  They like their pdf and want it back.  So I have taken a copy of the spreadsheet, cut out most of the tabs except the front page summary, added a table on the second tab that mimics the SharePoint list and pointed the fields and calculations on the summary page to the appropriate column in the data table.  That all works OK if there is data in the table.  Saved the spreadsheet in SharePoint as a template.  Back to the flow.

 

4)  Copy the template spreadsheet to a working template in a neighbouring folder in SharePoint documents - this is the bit that doesn't work!  I'll come back to it in a moment

 

5) Add a row of data to the table in the working copy of the spreadsheet - that works

6) Make a copy of the spreadsheet in OneDrive so I can convert it to pdf and save it back to the working directory on SharePoint as a pdf - that all works (thanks to Wonder Laura

7) I have a copy of the earlier email, exactly the same but only sent to myself while testing and it adds the pdf as an attachment - that all works

 

Back to step 4) copying the template from one SharePoint folder to another.  Sometimes it does and sometimes it doesn't.  If it doesn't copy then the data still adds but I end up with multiple rows in the table and that confuses the functions in the summary sheet.  And if I change something in the text of the template spreadsheet the change doesn't appear in the working copy.  Except sometimes those things do happen.  It seems to be fairly random whether the copy step occurs before the add row of data step.  I might be barking up the wrong tree but it feels like a timing issue.  Sometimes the flow just doesn't have time to finish the copy step before it starts the add data step so it just reverts back to the existing version of the working spreadsheet, rather than starting with a fresh, empty version.

 

So why not just delete the working spreadsheet after I have finished with it?  Good question!  I tried it.  But then the table doesn't exist when I try to set up the add data step so it doesn't know what fields and columns I am talking about and has a sulk.

 

Please can anybody help?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

GuyBoswell,

 

You can try putting in a Delay step after the SPO copy step, that will keep the Flow running while also giving the copy action time to process. This is a good call on your part and a pretty common approach for this sort of issue, since it's obviously working overall but intermittently affecting the data.

 

I'm curious if you're also running into some kind of limit:

https://docs.microsoft.com/en-us/power-automate/limits-and-config

https://docs.microsoft.com/en-us/power-platform/admin/api-request-limits-allocations

https://docs.microsoft.com/en-us/connectors/sharepointonline/

 

If you go over these limits and try a Delay step without seeing any changes, it may be best to just set up an incident through the Power Platform Admin Center.

 

I hope this helps!

 

Patrick

View solution in original post

3 REPLIES 3
Highlighted
Helper III
Helper III

Silence?!  Is any body out there?

Highlighted

GuyBoswell,

 

You can try putting in a Delay step after the SPO copy step, that will keep the Flow running while also giving the copy action time to process. This is a good call on your part and a pretty common approach for this sort of issue, since it's obviously working overall but intermittently affecting the data.

 

I'm curious if you're also running into some kind of limit:

https://docs.microsoft.com/en-us/power-automate/limits-and-config

https://docs.microsoft.com/en-us/power-platform/admin/api-request-limits-allocations

https://docs.microsoft.com/en-us/connectors/sharepointonline/

 

If you go over these limits and try a Delay step without seeing any changes, it may be best to just set up an incident through the Power Platform Admin Center.

 

I hope this helps!

 

Patrick

View solution in original post

Highlighted

Thank you Patrick, Delay works a Charm.  I am a bit confused but then I am not a proper programmer. But shouldn't a computer process run one step after the other until it finishes?  I wouldn't expect to have to introduce a delay, I would expect it to finish one step before it starts the next.  Guy

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (4,216)