Best answer

What's the expected behaviour of filters within loops?

  • 24 August 2022
  • 2 replies
  • 262 views

Userlevel 1

Hey team!

I couldn’t find documentation about this so I thought I’d ask here.

When you have a filter inside of a loop, and one of the iterations (let’s say #3 of 5) is filtered out, will the rest of the iterations run or does that one stop the rest from even being attempted?

In other words, if I’m trying to filter out files that are larger than 5 MB and these files come through…

1 MB, 2 MB, 5 MB, 3 MB, 4 MB

… will actions after the filter run for 1 MB and 2 MB then everything stops, or will actions run for 1 MB, 2 MB, 3 MB, and 4 MB.

Hope that makes sense! Thank you :)

 

icon

Best answer by nicksimard 24 August 2022, 19:18

View original

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

2 replies

Userlevel 1

That answers my question. Thanks!

Userlevel 7
Badge +11

Hey @ZapsAndApps!

That’s a great question. Let me use an example to demonstrate.

Here’s a Zap I set up:

So you’re wondering:

  1. Will I get a Slack message for only the first 2, then when 3 gets filtered out, do the rest also not run?
  2. Will I get Slack messages for everything except number 3.

Here’s what happened:

So each iteration of the loop is treated as if it was a separate run of a non-loop Zap. Meaning, filtering something out in middle iterations won’t affect later iterations.

Hope that helps!