Notifications
Announcements
function main(workbook: ExcelScript.Workbook) { let currentWorksheet = workbook.getActiveWorksheet(); // Look at every named item in the workbook. workbook.getNames().forEach((namedItem) => { // Find names containing "Review". if (namedItem.getName().includes("DATA")) { namedItem.delete(); console.log("DATA deleted"); } }); // Define Name data on workbook range on used range workbook.addNamedItem("DATA", currentWorksheet.getUsedRange(), ""); console.log(currentWorksheet.getUsedRange().getAddress()); workbook.refreshAllDataConnections(); console.log("Refresh done"); }
Office Scripts can't refresh most data when run in Power Automate. Most refresh methods, such as PivotTable.refresh, do nothing when called in a flow. Workbook.refreshAllDataConnections only refreshes when PowerBI is the source. Additionally, Power Automate doesn't trigger a data refresh for formulas that use workbook links.
PivotTable.refresh
Workbook.refreshAllDataConnections
Troubleshoot Office Scripts running in Power Automate - Office Scripts | Microsoft Learn
The following methods do nothing in a script when called through Power Automate. They still return successfully and don't throw any errors.
refresh
refreshAllPivotTables
Ellis Karim Blog | LinkedIn | Bluesky
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 501 Super User 2025 Season 2
Tomac 323 Moderator
abm abm 237 Most Valuable Professional