Hello, I've been trying to use a flow that downloads 3 excel files from my email to a SharePoint, extracts a range of data from them and places it in another workbook in the SharePoint. The data is parsed from a JSON string and then written in batches to the workbook. The issue is writing from one file to the workbook works consistently while the other gives a Bad Gateway 504 time out, despite the first file containing much more data than the latter. It has worked previously. Any Ideas?
My workaround solution to this is create a table to loop through batches (with firstrow & lastrow) specify.
I think Excel Online has a limit of 5000 rows per Power Automate action.
So I set to 3000 per batch.
You can also automate the processing of creating this batch table by calculating last row of sourcesheet => divide by 3000
Rzaneti's reply should be marked as the answer
I was getting a BadGateway in the Error Details
On the Run script action where was a GatewayTimeout
This was caused by a lot of lines that had suddenly been added to the excel file
The action usually took around a minute to run, but going from 300 to 500 rows in the excel file made it go beyond 120 seconds.
Optimizing and splitting up the actions is the thing needed to for this error.
Hi @Anonymous ,
I had this problem in the past. Actually, Power Automate has a limit for the "Run Script" action: your script cannot take more than 120 seconds to run. The alternative here is to break the script in smaller tasks or try to optimize your code to reduce the time for run it.
You can check the docs. here: https://learn.microsoft.com/en-us/office/dev/scripts/testing/platform-limits
Good luck with your flow and do not hesitate in reaching me if you need any additional help!
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional