Looping with actions

Steve
Participant V

Kinda burnt out and just wanna get this out. I’ll try to circle back later and provide some documentation.

https://www.appsheet.com/samples/Examples-of-loops-using-actions?appGuidString=7b9ae746-1f51-4ecb-8c...

26 33 6,844
33 REPLIES 33

@Steve

I would say this is a chunk of new features I would call! Thank you Steve. It probably takes a bit of time for me to digest and to understand the tricks behind, but it will be exicing journey for sure to get new skills and tools to enhance the functionalities of our apps!

Is this an extended usage of your tricks of this ?

Appreciate for your documentations anyway!

Thank you again Steve for all of your hard works to come up with this.

Yes, or maybe more of an evolution. My prior demo required a minimum of three actions, where this demo requires only two. Everything else is just applications of looping for common use cases. I intend to add more over time.

Sounds more great Steve.
Lesser number of actions involved could improve the performance of the app, saving the change in data on the backend data base faster than previous tips I hope. I implemented the previous tips to my app, and added number of rows like 50 rows, it takes a bit of while to complete the operation.
Does not have exact stats how long each tips will take time, but quick test gave me a feeling those new tips with 2 x actions perform faster.

Looking foward to seeing documentation and additional tips with interest.

I categorized your tips to “Appsheet hall of fame”

Started to dive in deeply to learn the essense of the tricks, even though i m still on the very first stage. For the action of “Add by Count”, now I understood how the combination of actions will do the jobs nicely, I will be moving onto the other actions which is getting more difficult to understand though!

For Add by Count, I thought removing “only if” constrain expression from " add by count: loop" action may end up the infinite loop. I tested (at my risk!) and saved the app editor. Run the action to add small number of copy (3), then tried to save the form. but I could not. Actually app editor “freezed”, i refreshed the browser. Tried few times and indeed app editor continuously freezed.
Pushed expression back in and save. Then back to normal, and operational.
FYG, Steve.

Yep!

Lynn
Participant V

Thanks! @Steve
Will check it out.

This is really excellent help. I’ve looked through them in the sample app, and can’t wait to read the documentation to help me understand them better. Thank you very much, Steve!

Thank you @Steve for this another very useful tip on looping actions.

Hi @Steve, your sample App is no more accessible. Could you share the link so we could copy the App?

I think embedding is broken. I’m updated the original post with the link to the app:
https://www.appsheet.com/samples/Examples-of-loops-using-actions?appGuidString=7b9ae746-1f51-4ecb-8c...

Hi @Steve,

This post is awesome, thanks for sharing. I have used it for a couple of apps. Would it be posible to do a loop inside a loop? I would like to distribute 100 task to 10 different people. How I have set up right now is that I would have to do this 10 times, one for each person to assign them 10 tasks each…

Definitely possible! It’s just a matter of structuring the control table(s) properly and adding appropriate actions.

Thank you @Steve for this.
I was able to make this work for adds/updates that happen within the app.

Im looking for a way to trigger this automatically when adds/updates happen directly on the spreadsheet not on the app. Im using Zapier to fill the spreadsheet with information from our reservation manager.

So I would like this to be triggered anytime there´s a new row added to the Spreadsheet.

I thought about using a Report to trigger this once a day for all the “new bookings of the day”, but Im not sure if this will work since this “looping action” is basically for individual rows.
Is there a way to select a group of rows to copy instead of just “the” row that is added or updated?

If you’re using Google sheets, one way could be to use Google apps script and AppSheet API to trigger the actions.

Thank you so much @Bellave_Jayaram

I am not very familiar with coding, and never used GAS before, but will give it a try. I already read some posts about it what you mentioned before:

but only found how to trigger GAS from events happening on Appsheet, not the other way around.
Do you have any documentation or links handy that could point me in the right direction?

Thanks so much!

There are several posts relating to this, for example- I am using the onedit function which in googl... - #13 by Nick_Parsons

MultiTech
Participant V

@Steve some sort of documentation or explanation of how all this works together would be much appreciated.

I’ve been digging through the app for about 25 minutes now, and I’ve only got a vague idea of what you’re doing.

hello friend.

One of the resoures for looping stuffs which I provided is here.

Add rows based on the selection of Enumlist on parent record, then add child records on save. Just using tricks from @Steve.EPL

Just as one of the resources for the community. You can find my sample donw there and dig into it.

Hi, here is another example. Same approach, but a bit simpler because it’s not using Control Tables / Columns

Can I add Quantity with Product name in The Loop.

MultiTech
Participant V

Did you know:


If you put additional actions AFTER the repeater action, they only fire once the loop is complete?

For instance: in this loop, I first create child records based on an enumlist inside the parent;

  • once all the child records are created (and the loop is complete):
    • I then create grand-children records (each associated with the newly created child).

Matt, this is awesome to learn. When you get a chance, it would be great if you created a sample app (or take one that someone created and modify it) where people can look inside to learn.

MultiTech
Participant V

Dear Matt, what a great man you are … What a kingdom is this !!! I also thank you.

Excelent work, for me this means that appsheet can cover any task 100%, this solution should be extra highlighted

Mark_11
Participant V

Hi,
this seems great to me.

I’m wondering if i can use something similar for my project, or is better to try another way.

It is a little bit different scenario.
I’d like to use it to generate a checklist.
I have 3 table.
Todolist (clean checklist, each row is one step)
Job (blank table, add row to start new job)
JobEvent (list of step to complete the job)

So i have a table with my checklist, every steps, one row…not the usual in row checklist plenty of Y/N.
I’d like to copy every steps in a new table “event” where the user can edit, do action, add note…on every rows (step), so i can restart the checklist maintaing the todolist clean.

thanks

Yes you can apply the looping to create the checklists when the parent Job is created. I have done very much the same thing.

thanks,
do you have some example of that?
i’m struggling with the structure at the moment.

I do not.

Nicolás
Participant IV

Thanks Steve, excelent work, i am still trying to fully understand the control table and how to pass the list to rows but there’s light on the end of the tunnel. Thank you

Hi @Steve, your tip was all I needed ! Thanks for your devotion to help us. I had done using Google Apps Script, but It’s much better to use recurrent Actions. In my case, I used an Enumlist field to save all child records keys I needed to create and subtracted it after each loop. So, the condition to loop is if this field is not empty.

Top Labels in this Space