Hot to queue several ApiTemplate pdf generations and execute them one after another?

Hi everyone
I'm using APITemplate to create pdf.

in each Pdf ther is a list of expenses by supplier.
The user can select one to several suppliers.
And I need to call Apitemplate API to generate each pdf one after another.

After selecting the values, I created an array in which the data json is stored for each supplier.
I would like to go through the array and launch the API (response from Apitemplate can take several seconds) one supplier after the other. And eventually get the pdf returned.

I have issues to do it in retool since :

  • I don't manage using async in js loops
  • I am not sure what is the most efficient feature of retool to do so.

Thanks for your help