Question

Can I create a loop in Looping by Zapier that moves on to the next iteration when the current one has finished?

  • 6 June 2023
  • 3 replies
  • 372 views

Hi everyone,

The system proposed by "Looping by Zapier" forks the Zap for each item, so that for 10 iterations, all 10 are launched simultaneously without waiting for the last iteration to finish.

For my part: I'd like to create a loop that moves on to the next iteration when the current one has finished.

Could you please tell me how to do this?

Kind regards.


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +11

Hey there, @gomddc8d. Thanks for joining the Community! 🙂

There was a similar question asked a while back where it was recommended to use a Formatter (Numbers > Perform Math Operation) action to calculate a delay value for each loop iteration and then add that value into a Delay For (Delay by Zapier) action:


If you’re not familiar with using Formatter or Delay actions we have some guides on them which you may find useful:



Hope that helps to get you pointed in the right direction. Please do keep us updated on how you get on with this!

Hey, thanks for your answer :-)

 

But we don't want to use delays because that is not accurate ; we want to make a conventional loop. 

 

Is there another way ?

Userlevel 7
Badge +11

You’re welcome, @gomddc8d!
 
Delay would be the only way to do it in a loop as the loop iterations would be run simultaneously. The Delay action does also have a Delay After Queue event which you could add inside the loop. It would allow the loops to be run one after the other and would get rid of the need for that additional Formatter action that would be required for the previous suggestion. But I’m not 100% sure whether it would respect the order of the items in the loop or whether the items would be queued in random order. 

In doing some further digging on this I found an feature request for the ability to have loop items processed in the order they are provided, rather than simultaneously. So I’ve gone ahead and added your vote to that. I can’t make any promises as to when that feature would be added but we’ll be sure to send you an email notification as soon as it is!

There are a couple alternatives to using a Delay that I can think of. If there were always only going to be 10 items in the loop you would get rid of the Looping by Zapier action and set up 10 separate actions for each one in the Zap. That way it would only move onto the next action when the previous one is finished.

Another way would be to potentially write your loop to handle each item sequentially in a Code by Zapier action. But this would be a more advanced option so might not be ideal. If you do manage to come up with an alternative solution in the meantime, please let us know! 🙂