Workbook.refreshAllDataConnections() is not supported in Power Automate.

MMPB 110 Reputation points
2023-04-20T06:58:58.2433333+00:00

Dear all, I have an excel sheet with an active connection which I am able to refresh to get the newest data.
Now I've got another PowerAutomate Flow which is working fine with a script inside this Sheet to send me via Teams numbers which I want to be notified about.   Unfortunately it only works if I am updating the workbook manually via Data-Refresh all, or if I am executing the script inside The workbook via automate this code line works:
"workbook.refreshAllDataConnections();"

It is now also possible to test the flow in Powerautomate and get all data (without the refresh code line).
With the refresh Code line I get this error message:

We were unable to run the script. Please try again.
Runtime error: Line 7: Workbook.refreshAllDataConnections() is not supported in Power Automate.
clientRequestId: 0b8eaf2a-1429-430a-8ae6-21fcf4330213

How can I refresh the workbook via Power Automate?

Microsoft 365 and Office Development Other
Microsoft 365 and Office Excel For business Windows
{count} votes

7 answers

Sort by: Most helpful
  1. Fabio Plos 0 Reputation points
    2023-10-17T23:28:24.3+00:00

    it seems that for now the only solution is:

    Select Data > Queries & Connections > Connections tab, right click a query in the list, and then select Properties.

    Click the Usage tab.

    1. Select the Refresh every check box, and then enter the number of minutes between each refresh operation.
    2. fyi 1440 minutes is one day
    3. repeat for all connections
    0 comments No comments

  2. Dung Thuy Nguyen 0 Reputation points
    2023-12-05T07:51:10.57+00:00

    Screenshot 2023-12-05 152414

    This might be the reason: Currently Excel Online does not support refreshing data sources from Power Queries. It seems that Excel for Web only allows Odata or table/range.

    If you build a new flow for Power Automate Desktop instead, it will be easier to consolidate Excel files

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.