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. Tyler Graham 1 Reputation point
    2023-04-20T19:11:35.3633333+00:00

    I don't have an answer for this, but a possible workaround. I just changed my Run Script action from the now, apparently, defunct Refresh script to a script that simply changes the Worksheet's name. If whatever you're doing doesn't require a specific worksheet name, you can do this to force Power Automate to read the most recent values in your spreadsheet. Works for me in other flows where I previously had to run a 5 minute delay action to get Power Automate to recognize the new table.


  2. Dennis-2732 0 Reputation points
    2023-09-27T08:19:54.3466667+00:00

    Is there already a solution to the problem ?

    Has there been an answer from the Microsoft team when the problem will be fixed?

    0 comments No comments

  3. Carlos Renato Rodrigues 0 Reputation points
    2023-09-27T13:07:11.95+00:00

    Hello,

    Is there an alternative to refresh only a specific sheet?

    BR

    Carlos

    0 comments No comments

  4. Travis Webb 0 Reputation points
    2023-09-27T14:17:54.1066667+00:00

    This is the main reason I used PA and this has been a trainwreck for me.

    0 comments No comments

  5. 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