Often, in script functions, I have to search all rows in a sheet to locate a set of rows matching a criteria. This is dynamic criteria. E.g. Just before accepting an invite, check is there an existing invite for the same email address. Email address is the dynamic filter parameter.
What I do is this. I have a sheet named “Search XYZ sheet” and then on first cell, I put a formula with query which pulls data from the desired sheet and pass parameters to the query function. Now from the script function, I set the formula based on dynamically passed arguments. Read the rows and then make decision about existence of what I am looking for.
I have some doubts:
How will script invocation concurrency be handled? Say n users simultaneously trigger an event (say row added) which calls the function. Is there a chance of calls / parameters / results getting mixed up?
Is there another way to do this?
Thanks for help.