I have a script which takes information from a Google Sheet which collates data from multiple different sources then sends an email with the relevant data.
However, due to the numerous dynamic functions used such as Importrange, the sheet will sometimes need to recalculate and need some additional attempts to load.
Is there a way to allow a script to account for this and execute after these recalculation attempts are finished?
I have already attempted to use SpreadsheetApp.flush and Utilities.sleep after the initial passing of the spreadsheet name e.g:
var wb = SpreadsheetApp.getActiveSpreadsheet();
var dataSheet = wb.getSheetByName("Test Mailsheet");
SpreadsheetApp.flush();
Utilities.sleep(50000);
To no avail. Is there any other method to force a sheet to wait before grabbing the data before executing?
user25502000 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.