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 - BadRequest.
Power Automate
Suggested Answer

Run script - BadRequest.

(0) ShareShare
ReportReport
Posted on by
HI facing the issue
 
 
Run script - 
 
Bad Request
Office JS error: Line 2: Workbook refreshAllDataConnections: There was an internal error while processing the request.
clientRequestId: 929a1aa0-364b-453f-adc5-66707476fd91
Categories:
I have the same question (0)
  • frago Profile Picture
    226 on at

    This error message doesn’t give us enough information to diagnose the issue. Could you please share some screenshots and, if possible, the Office JS script/file you’re running?

    Unless there’s more context, it’s hard to determine the root cause from this alone.

    ------------------------------------------------------------
    If this solved your issue, please mark it as ✅ Accepted Answer.
    If it helped, feel free to give it a 🩷 Like!
     
    Best regards,
    Piotr
     
     
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,031 Moderator on at
     
    As suggested by @frago, it is always better to provide the details as much as you can to explore and provide proper solution.
     
    Error:
    Workbook refreshAllDataConnections:
    There was an internal error while processing the request
     
    This error usually means the Excel Online (Business) Run script action is failing while trying to refresh data connections, not that the script syntax itself is wrong.
     
    This typically happens due to one of the following:
    • The workbook contains Power Query, external data connections, or pivot refreshes that Excel Online cannot refresh reliably
    • The file is open, locked, or recently edited when the flow runs
    • The workbook is stored in SharePoint/OneDrive, but the connection requires desktop Excel or a signed‑in user context
    • A Microsoft service-side transient issue affecting Excel Online automation
    The BadRequest response is misleading. Most of the time, this is not a permissions or script issue.

    Important note
    This is a known reliability limitation of Excel Online + Power Automate. The same script may succeed intermittently and fail later without changes.
     
    If refreshAllDataConnections() is required, the only fully reliable options are:
    • Refreshing via Excel Desktop
    • Refactoring the flow so the refresh occurs outside Power Automate
    Avoid or isolate refreshAllDataConnections where possible.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard