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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel Adding Columns: ...
Power Automate
Unanswered

Excel Adding Columns: Graph API has timed out

(0) ShareShare
ReportReport
Posted on by 3

Hi All,

 

I am attempting to create a power automate task that takes an emailed excel file, adds two columns with static contents for every row, and then saves the file to a local folder.

 

What I have created already worked for my test files - however it now throws an error when the spreadsheet is much larger (6000ish rows). The flow runs for approximately 20 minutes and then returns the error code 504, with message "Request to Graph API has timed out"

 

My Question is - is there a way to change these timeout settings as a workaround (I don't mind if it takes a long time to finish), or is there an alternative method within Power Automate / script suggestions that can accomplish this within the timeout limit?

 

Thanks!

 

"error": {
 "code": 504,
 "source": "australia-001.azure-apim.net",
 "clientRequestId": "--",
 "message": "BadGateway",
 "innerError": {
 "status": 504,
 "message": "Request to Graph API has timed out.\r\nclientRequestId: --",
 "error": {
 "message": "Request to Graph API has timed out."
 },
 "source": "excelonline-ae.azconn-ae.p.azurewebsites.net"

 

Here is the script I am using:

 

function main(workbook: ExcelScript.Workbook) {

 workbook.getApplication().setCalculationMode(ExcelScript.CalculationMode.manual);

 // Adding Class Column
 let range = workbook.getActiveWorksheet().getUsedRange();

 let rows = range.getRowCount();
 let cols = range.getColumnCount();

 range.getCell(0, cols).setValue("class");

 for (let row = 1; row < rows; row++) {
 range.getCell(row, cols).setValue(8);
 }

let updateCols = cols + 1

 range.getCell(0, updateCols).setValue("update");

 for (let row = 1; row < rows; row++) {
 range.getCell(row, updateCols).setValue("Y");
 }

 workbook.getApplication().setCalculationMode(ExcelScript.CalculationMode.automatic); 

}

 

Flow steps for background:

Flow_error.JPG

 

 

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi Sam, 

    If I am not wrong, your script is trying to update the values cell by cell. From my limited knowledge and what I have experienced so far, this approach may not work for the large data set. 

     

    Change the approach to update the excel in batches for range of values. It should work.

    It worked for me and I could update 300K records with the batch approach. 

     

    There is MS documented example... 

    https://docs.microsoft.com/en-us/office/dev/scripts/resources/samples/write-large-dataset?view=office-scripts

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard