Trigger a looping action by schedule

I've built a looping action based on a solution that @MultiTech posted:
https://www.appsheet.com/samples/How-to-loop-through-a-list-and-create-child-records-for-each-item-i...

It works fine, "manually". I want to automate it based on a schedule but I haven't found the way to do it.

  • The loop action performs calculations 8 days after the loans due dates. There are 2 due dates during a month: the 15th and the end of the month. 
  • All I have to do is enter the date of the 15th or the end of the month date into a form. This must be done 8 days after the due dates (23rd for the 15th and 8th for the end of the previous month).
  • When the form is saved, it executes the looping action.

I want to run the looping action automatically every 23rd and every 8th of a month.  I've tried bots without success. 

This is the form with the end of month of the previous month (March 31).

maretec_0-1713316081477.png

The looping action runs when the form is saved.  The following screenshot shows it.

maretec_2-1713316298269.png

This all works fine when I enter the date and click the Save button. The automation should do the same (enter the date and call the loop action as if the form had been saved).

Thanks in advance for any assistance.

 

Solved Solved
1 8 124
1 ACCEPTED SOLUTION

Looping for bots must be done through the API. 

  • I've got a video about how to do this, and it works off the starting point of using an action loop to create records.

https://youtu.be/4p4F1fme5h8

 

View solution in original post

8 REPLIES 8

Looping for bots must be done through the API. 

  • I've got a video about how to do this, and it works off the starting point of using an action loop to create records.

https://youtu.be/4p4F1fme5h8

 

Hi @MultiTech 

I noticed that behavior too recently. Would you happen to have submitted a ticket to the dev team to solve this kind of situation? (I did not)

@Aurelien What kind of behavior are your talking about?

While searching for a solution, I saw a post that mentions using API:
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/How-do-I-get-a-Schedule-Bot-to-trigger-a-Data-C...

I haven't worked with API. I'll check your link.

I watched your video. What I understand is that the API replaces the looping action. If so, it means I have to delete all the actions of the loop and do everything with the API. Am I right?

No need to delete the actions, these will work if you ever need to execute the loop client-side; the bot's API call does the same thing, only through the server.

But to be clear, only one of them should fire off at once; 

  • Either you make the records using the actions
  • Or you make the using the API

Aurelien
Google Developer Expert
Google Developer Expert

The bot calling a loop of actions, like a recursive function. 

Let's say you have an enumlist, you wish to add items to another table from this enumlist: a combination of "execute a sequence of actions" and "execute an action on a set of rows" will do the job.

But when ran by a bot, the looping won't work.

Let me know if I'm unclear 🙂

 

@Aurelien wrote:

But when ran by a bot, the looping won't work.


🤔 I believe there is a discussion about this, perhaps several, from a handful of years ago when automation first came on the scene.  There's some nuance that was covered back then, you might be able to find those posts and acquire that knowledge for yourself. 

You can't run action looping in automation, they are diametrically opposed in operating style; actions are sequential, bots are parallel. Trying to run a sequential operation in a parallel execution results in an infinite loop.

Top Labels in this Space