web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error Running Office S...
Power Automate
Answered

Error Running Office Script - Bad Gateway

(0) ShareShare
ReportReport
Posted on by 43

I am working on a flow that relies on dynamic table being built since Power Automate does not like Excel without tables. I have been running this slow for months and not sure why it stopped working as of Saturday night (2/24/24). I am getting the error below when running a basic flow:

 

Screen Shot 2024-02-25 at 9.57.36 PM.png

I attempt to fix the connection but that's not the issue. Here is the code snippet from Office Scripts, which is not loading either when I attempt to open it in Excel Online. It is only meant to create a dynamic table:


function main(Workbook: ExcelScript.Workbook) {

let selectedSheet = Workbook.getActiveWorksheet();
let usedRange = selectedSheet.getUsedRange();
let newTable = selectedSheet.addTable(usedRange, true);
newTable.setName("Table1");

}
 
Also, this is the error I am getting in Excel Online when opening any script, including the Microsoft generic scripts:
 
Screen Shot 2024-02-25 at 10.17.23 PM.pngScreen Shot 2024-02-25 at 10.21.55 PM.png

Any help would be appreciated!

Categories:
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @CountDooku_415 

    A 502 is usually a server error. According to your description, you have had a problem in the last few days. You can try recreating the script and flow and test if there is still a problem.

     

    Best Regards,

    Yueyun Zhang

  • CountDooku_415 Profile Picture
    43 on at

    Even attempting to create a new script, I get this error:

    Screen Shot 2024-02-25 at 10.21.55 PM.png

    Even remoting in to my work computer, from behind the firewall, I am getting the same error above.

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @CountDooku_415 

    This seems to be your Excel Online script that can't connect to the server. Everything works fine with me.

    vyueyunmsft_0-1708929082993.png

    First of all, we need to make sure that the automation script can be created and run successfully in Excel Online.

    This one is weird, I'm sorry I'm not an Excel expert. You can try consulting with a technical engineer on the Excel forum about Office Script connectivity.

     

    If the problem still exists,  I suggest you create a support ticket for professional assistance following the below procedure.

    Get Help + Support - Power Platform | Microsoft Docs

     

    Best Regards,

    Yueyun Zhang

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard