web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel Pivot Table Dat...
Power Automate
Unanswered

Excel Pivot Table Data Refresh (Power BI Source) using Power Automate and Office Scripts

(0) ShareShare
ReportReport
Posted on by
Hello everyone,
 
I'm seeking clarification on the feasibility and reliability of automatically refreshing data connections (sourced from Power BI ) used within Excel Pivot Tables.
 
My Setup: My Excel workbooks are stored on SharePoint. Each workbook contains multiple sheets and several Pivot Tables. The data source for these Pivot Tables is a Power BI dataset
 
My Current Automation Attempt: I've implemented a scheduled Power Automate Cloud flow that triggers an Office Script for each relevant Excel file.
This refresh is initiated by an Office Script executed as part of a Power Automate Cloud flow.
 
Here is the Office Script I am using:
 
function main(workbook: ExcelScript.Workbook) {
  workbook.refreshAllDataConnections(); // Refreshes external data connections
  
  // Optional: Refreshes all pivot tables
  let pivoTables = workbook.getPivotTables();
  pivoTables.forEach(pivot => {
    pivot.refresh();
  });
  // Optional: Saves the workbook (Excel Online often does this automatically after a script)
  // workbook.save();
}

 

My Problem: Despite employing workbook.refreshAllDataConnections() and pivot.refresh(), I've observed that the data in my Pivot Tables does not reliably update, even though both my Power Automate flow and the script execution are reported as "Succeeded."

I am uncertain if this approach (Office Scripts via Power Automate Cloud) is the correct one

 
Is this method generally considered a reliable approach for automating Excel data refreshes from Power BI?
 
Why might this method not always work, especially on larger files with multiple sheets and Pivot Tables? Are there specific performance limitations or timeouts in executing Office Scripts via Power Automate Cloud that could prevent a complete refresh for more complex files?
 

Any help, shared experiences, or suggestions would be greatly appreciated.

Thank you in advance for your time.

Categories:
I have the same question (0)

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 484

#2
Valantis Profile Picture

Valantis 477

#3
Haque Profile Picture

Haque 456

Last 30 days Overall leaderboard