Looping with actions

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-8c39-b322e1c12da6

18 Likes

@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.

4 Likes

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.

4 Likes

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” :smiley:

5 Likes

Thanks! @Steve
Will check it out.

1 Like

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!

1 Like

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.

3 Likes

Yep! :slight_smile:

1 Like

:smile:

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

1 Like

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

1 Like

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-8c39-b322e1c12da6

3 Likes

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…

1 Like

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

2 Likes

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.

2 Likes

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

1 Like

3 Likes

@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.

2 Likes