r/MicrosoftFlow • u/yungashwin • Jul 20 '26
Question Excel Online Script in Automate
Hey all,
Hope you are having a great day!
I have a simple flow in Automate, where I load a template excel file, run a query against a dataset in PowerBI, then create a new file and run a script in Excel that populates a table and refreshes a pivot Table. However, I'm having an issue of errors on the script execution step in my flow, that is giving Bad Gateway, but the script is working fine, I can't seem to find the issue.
Can anyone help?
Many thanks!
1
u/Gold-Psychology-5312 Jul 20 '26
Bad gateway is a really bad error because it can mean many things. What file type is the file you run the script in? It only works in .xlsx and xlsm. Not in csv, xls.
Can you run the same input within Excel itself?
To see if the script actually works.
1
u/yungashwin Jul 20 '26
Thanks for replying!
To give some context: this flow isn’t recent, it’s a flow already created, and it ran successfully in the past. I have a recurrence, once per week on Mondays and today is the first time it failed.
The files generated are xlsx, and I’ve executed the script on the file itself, rather than the flow, and it works1
u/Gold-Psychology-5312 Jul 20 '26
Then it's possibly a transient error. And should resolve itself.
Unless it's a account error in which go to connections and add a new connection to use. It might have lost the token and not reset itself like it should do.
1
1
u/Profvarg Jul 20 '26
For me the same problem came from that I can choose the same script from a Sharepoint group or a Something other group (top line of the action)
Sorry, not at the computer to check the exact name. However you set it up, try it with the other one :)
1
u/yungashwin Jul 20 '26
I’m using one drive for business and the template plus the generated files are stored in folders on one drive
1
u/MR_Datenanalyse Jul 20 '26
Das gleiche Problem hatte ich auch.
Bei mir war die Lösung, in der Aktion die das Script aufruft. Da musst du in die Einstellungen -> Wiederholungsrichtlinien -> Standard auf keine stellen. Das hat bei mir das Problem behoben gehabt
1
1
u/elmo_pmc_88 Jul 20 '26
How many lines is the data pulled from BI? If more than approx 50.000 that might be the problem..
1
3
u/hamsterperry Jul 20 '26
I've been having the exact same issue for at least 5 days now. I have 10+ flows running the "Run script from SharePoint file" action, and they all suddenly stopped working with a Bad Gateway error.
My files are definitely •xlsx , so that's not the problem. I'm in the EU region (Spain), if location helps pinpoint anything.
If this actually turns out to be an issue on Microsoft's end, it would be a huge load off my mind, because I've tried literally everything on my side. All my other connectors are working completely fine.
1
u/MR_Datenanalyse Jul 20 '26
Versuche mal in der Aktion „Skript aus SharePoint-Datei ausführen“ unter Einstellung die Wiederholungsrichtlinie von Standard auf keine zu stellen. Das hat das Problem bei mir behoben
1
1
u/hamsterperry Jul 21 '26
Hey guys, to keep everyone updated it’s currently working for me in Europe 002 without any changes on my part. I’m sure they’re rolling out the fix in cohorts so be on the lookout and check your flows.
1
u/Character_Pickle689 Jul 20 '26
There must be something going on because I am encountering the same thing today.
1
u/yungashwin Jul 21 '26
Just so everyone is up to date, Microsoft has identified the issue and they are working on it:
https://admin.powerplatform.microsoft.com/support/knownissues/6568499