I have a report file get the content from other files in a Google drive to generate a report. The script do the following
- Get list of files in folder (and their IDs)
- Create new sheets using predetermined form
- Get content from files in folder into the sheets (via IMPORTRANGE)
- Get summary of files' content in each sheet (progress of projects)
- Get the summary in sheets into one single sheet (via INDIRECT)
However, it seems that the result could behave wildly. Sometimes IMPORTRANGE will not get the correct file content even all the results lead to it are all correct. Sometimes INDIRECT will not get error even when enter the formula exactly the same manually will get the correct result. Sometimes the function getSheets() will be error but most of the time it will not.
When the result is not correct, I just delete the newly created sheets and run the code all over again. After awhile, they all will be correct.
So my question is what's the problem/limitation with google sheet or script that they will have results varies wildly between run?