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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Office JS Error

(0) ShareShare
ReportReport
Posted on by 108

Hello,

 

I have created a run script flow which refreshed my excel file(51kb, data connection power bi). 
Script: 

function main(workbook: ExcelScript.Workbook) {
  // Refresh all data connections
  workbook.refreshAllDataConnections();
}

When i test it works fine. But when i scheduled, it is showing us error:
We were unable to run the script. Please try again.
Office JS error: Line 3: Workbook refreshAllDataConnections: There was an internal error while processing the request.
clientRequestId: 9e3e1b9e-d927-4d73-a6e0-a01a8caa49d3


Can you tell us where is the problem. I have referred many post but didn't find any concrete answer.

Thank you in advance.
Categories:
I have the same question (0)
  • rzaneti Profile Picture
    4,241 Super User 2025 Season 2 on at

    Hi @Sanskruti ,

     

    It looks like there is a bug with this Office Scripts method when you run it with Power Automate. A Microsoft mentioned that they were working to solve it, but there is still no answer on that. Check the trends below: 

    https://learn.microsoft.com/en-us/answers/questions/1250098/workbook-refreshalldataconnections()-is-not-suppor 

    https://powerusers.microsoft.com/t5/Using-Connectors/Running-office-script-with-Workbook-refreshAllDataConnections/td-p/2117793 

     

    Some users are mentioning that you can solve the problem by removing the '()' from the end of you line 3, but I don't recommend you to do it. It is probably just not calling the refreshAllDataConnections() method, which avoids the error message but also does not refresh you connections 🙂

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard