How to make function wait for all queries to execute before triggering again?

Hi @joelime! In case you haven't already looked in our docs, we have some info on Scripting Retool > Promises and Async Queries. You could also explore these docs on Async/await for further reading. And, last but not least, there's an existing community thread that discusses best practices for synchorous JavaScript queries.

Hope this helps, and let me know if there's anything else I can help with!