Excel Office Script Refresh via Power Automate for a Power BI Connection returns a Run Script error

James Caggiano 0 Reputation points
2024-11-26T19:04:11.5133333+00:00

I have been utilizing an Office Script Power Automate flow for around two years. The flow refreshes a Power BI connection into Excel Online using an Office Script. This is the script used:

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

This script had worked properly until August, where this flow began to fail and experience a Run Script error. I have tried several variations of a Refresh script in attempts (including recreating this script using a record action, dropping the ending parentheses, and trying the RefreshAllPivotTables/Refresh calls which do not work in Automate) to see if I could ever get the flow to run again.

The data set used for this flow is a Power BI Usage Report, with the goal of these actions to refresh the data set to pull new usage data from Power BI. Reading several documentation pieces posted from Microsoft, this appears to meet the criteria of this action: https://learn.microsoft.com/en-us/office/dev/scripts/testing/power-automate-troubleshooting. I have been stumped as to why the functionality suddenly began to fail without tweaking the flow or scripts. If there are any solutions to this or alternative approaches to take, it would be much appreciated.

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,870 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,126 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.
4,201 questions
{count} votes

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.