My flow stops at the step where I need to run an Office Script on a file. The error message being thrown:
We were unable to run the script. Please try again.\nOffice JS error: Line 7: Worksheet getRange: The request failed with status code of 504, error code UnknownError and the following error message: \r\nclientRequestId: 9de62ff1-39da-48ba-9dda-3e045296a929
I checked the line mentioned in the error message above and it seems to be timing out when I set the formula for cell S2?
let lastRow = usedRange.getRowCount().toString();
// Line 7: Set range S2 on selectedSheet
selectedSheet.getRange("S2").setFormulaLocal("=SWITCH(TRUE, T2 = \"\", \"\", COUNTIFS(T$1:T$" + lastRow + ", T2) > 1, \"More than one\", \"Only one\")");
Is there something I can do to remedy this? When I run the Office Script manually via Excel Web, it works without issues but when it's being called by the flow, it seems to be timing out. To add, this is a file that currently has 16k rows. I've already set the calculation to Manual prior to this step.

Report
All responses (
Answers (