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 / Run script from ShareP...
Power Automate
Suggested Answer

Run script from SharePoint library failed

(0) ShareShare
ReportReport
Posted on by 8
I have a flow that has been running smoothly for a couple of months without any issues. However, today it did not work, and I encountered an error when using the 'Run script from SharePoint library' function. The error message is as follows:

 
{
  "error": {
    "code"502,
    "source""flow-apim-europe-001-westeurope-01.azure-apim.net",
    "clientRequestId""2782005a-2bd3-43ad-b0bf-6cf185b84a1c",
    "message""BadGateway",
    "innerError": {
      "message""We were unable to run the script. Please try again.\r\nclientRequestId: 2782005a-2bd3-43ad-b0bf-6cf185b84a1c",
      "logs"null
    }
  }
}

The script is in the same folder as new file that I am creating.



I would be very grateful for any assistance you can provide!
If you need more information about my flow, feel free to ask.
Thank you!
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,968 Moderator on at
    Hi,
     
    If you go to where the file is, and manually execute it (please try it not just say it works), does it work?
     
    As long as there are no script errors, nobody changed permissions and it's still in the same place it was before, as in nobody moved it,
    no one changed it, (look at the scripts last modified date), then we also have to review what actions it is doing
     
    Since its in SharePoint, I am going to assume you have Versioning on, so I would look at who did what, if anything to the script.
     
    Its very possible that an Action inside the script has now changed and or needs a not required before privilege.
     
    I would definitely start the manual test first, then review the history of the file to see who changed what, AND to validate that the files it will impact
    or be used and actions aren't something a problem now.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard