Looping of Automation | create PDF

Hi all

I have set up an ordering application with Appsheet. At the end of the month, I want to create a PDF for every customer with all their orders.

I have added a "helper" table called "Prints" to trigger the PDF creation. It includes the following columns:
[Druckauswahl],
[Monat],
[ListofCustomers] (unique(SELECT(Orders[KundeMail],and(month([Liefermonat])=month([_thisrow].[monat]),year([Liefermonat])=year([_thisrow].[monat])))))
, [CountofCustomers] (count([ListofCustomers]),
[CurrentCustomerIndex] (initial value=1)

The automation is set up as follows:

EVENT: Adds and updates of Table Prints with the condition: and(in("Gastro Monatszusammenfassung",[Druckauswahl]),[CurrentCustomerIndex] <= [CountofCustomers])

TASK 1: create the pdf (file name: LOOKUP(INDEX([ListofCustomers],[CurrentCustomerIndex]),"Kundendaten","Email","CustomerName")

TASK 2: Run Data Action "CustomerIndex+1" which is: Set value [CurrentCustomerIndex]=  [CurrentCustomerIndex]+1

apparently the data change in Task 2 does not trigger the process again.. (even though I have checked the box "Trigger other bots").

Therefore, I have added a second automation, which is exactly the same except it is only triggered by updates.

It always works for 5 customers (5 separate pdfs are successfully created). but then it stops. When I manually edit [CurrentCustomerIndex] it will trigger the automation again and it will run until it randomly stops again. The Log analyzer does not show any error.

Is anyone experienced in setting up such a loop? what might be the problem? and/or is there a better way to do it?

Thank you for your help!

 

0 2 98
2 REPLIES 2

5 is the maximum number of iterations for a "trigger other bots" scenario, as described here:
https://support.google.com/appsheet/answer/11432969#configure-bot

Have you thought about setting up a monthly forEachRow Bot on a Customers table?

Though you can also do it without the Customers table if you create a slice from your Orders table.. having only one row per customer and then do the same Marc proposed 

Top Labels in this Space