Excel Office Script Refresh via Power Automate for a Power BI Connection returns a Run Script error
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.