Question

Is it possible to exit a loop and move on to non looped steps?

  • 28 March 2023
  • 1 reply
  • 1505 views

Hi,

I’ve looked into the documentation and older forum questions and I can’t really find anyone talking about this in the specific way I’m looking for.

What I want to do is to have looped steps in the middle of my Zap, but I want the loop to end before the end of the whole Zap. Here’s an example of what I mean:

  1. Form is filled by client and there’s a field that contains multiple answers split by commas
  2. Split the text in that field by comma
  3. Start loop
    1. For each item in the field, do X
    2. For each item in the field, do Y
  4. End loop
  5. Do something else that has nothing to do with the loop

Every time I create a loop, all the subsequent steps are nested inside the loop automatically. Is there a way to avoid this? I know I could just put anything past step 4 before the loop, but the logic of my Zap makes more sense if I put them after the loop.


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

1 reply

Userlevel 7
Badge +14

Hi @fiscalitemtl 

Good question.

Looping help article: https://help.zapier.com/hc/en-us/articles/8496106701453#frequently-asked-questions-0-4

 

How do I stop a loop from running in subsequent action steps?

All actions after the looping step will run for each iteration of the loop.
If you don’t want an action step to loop:

  • After the last step you want to loop, add a filter step.
  • Set the filter to only continue if the value loop_iteration_is_last matches the (Boolean) Is True condition.

The filter will run in every loop but will only pass in the last loop.
Any actions step after the filter will run once in the last loop and use only 1 task.

miscEye icon Note

If you want an action step to only run once, add it before the looping step, if possible. This will use less tasks and the filter step won’t be needed.