Skip to main content

Hello, 

I have a zap that has branches. 

In the 1st one I have a loop, at the end of this branch a filter, to only continue if it’s the last loop iteration. 

The issue here is that at the first loop, the filter stops the zap, and trigger another run…

It means that my zap will run twice if there are two interation, instead of having 1 run and the iteration in it.

Each step before the loop are duplicated…

Here are some screenshots.

 

Hi @Wellow123 

The Filter step configuration is the issue.

You have the left side being compared to itself on the right side, meaning it will always be TRUE and thus pass.

You need to use a different left side variable (see below) and set a static right side value.

 

 

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.


Hi @Troy Tessalone 

Thanks for the help. 

I changed the logic to this:

 

It worked as expected, but is it still normal that I see as many zap run as iterations there was in the loop?

I would have though that I would only have 1 run, and each iterations in the run details view.


@Wellow123

Help: https://help.zapier.com/hc/en-us/articles/8496106701453-Loop-your-Zap-actions#nested-loops-0-6

 

Frequently asked questions

Why do I only see one loop when I test my Zap?

When you test a loop action, the Zap will only create the first loop.
It will not create any other loops during the test.

When the Zap runs live, all loops will run and appear in your Zap History.

How do loops appear in Zap History?

Each loop iteration will result in a separate Zap run.

How many tasks do loops use?

  • An action that runs before the loop will appear in each Zap run but only use 1 task.
  • The looping step uses 1 task.
  • Each action step after the loop will use 1 task for each loop that runs. For example, if your loop runs 500 times, an action step after the looping step will use 500 tasks when the Zap runs.

Thanks again @Troy Tessalone !


Reply