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

MMPB 55 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?

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,646 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,680 questions
{count} votes

12 answers

Sort by: Most helpful
  1. 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

  2. Rodolphe F 5 Reputation points
    2024-04-04T15:39:20.4566667+00:00

    Same issue here! April 2023 and one year has passed. April 2024, still no solutions? I have the same issue with a script containing : workbook.refreshalldataconnections() > nothing happens. No message of any error but none of my queries in Power Query have been refreshed at all. I tried without (): still don't work. And of course the "refresh workbook" step in Power Automate doesn't exist. Totally fake.
    Thanks for your help!

    0 comments No comments