Best answer

How to implement a delay between loop iterations?

  • 8 October 2021
  • 5 replies
  • 708 views

Userlevel 1

Hello,

 

I am trying to build a zap where given a list of customers, the loop will send an email to all those customers, however not at the same time. Between every email there will be a delay of 40 minutes. This means the first customer in the list will get the email immediately, the second after 40, and the third after 80.

Tried to do this by implementing a delay after the email is sent in the loop, however it does not work.

icon

Best answer by christina.d 9 December 2021, 01:53

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.

5 replies

Userlevel 6
Badge +6

Hey, Yes that is possible, You can delay each loop execution with the difference of 40. 

 

Use Formatter by Zapier application and do a simple multiplication. between 40* Count. (You can get count by doing simple mathematical calculation Loop iteration count -1 ) 

 

So for the 1st loop execution it will delay for 0 minutes, for 2nd loop execution it will delay for 40 minutes and so on). The above action will give a number. Paste this number in the next step of Delay by Zapier → Delay For

 

Note - Zapier can hold a Task only for 1 month. You won’t be able to Delay for more than 4 Weeks.

 

Hope this works for you!

Userlevel 1

Hey,

 

Thanks for the reply. Looks like a great idea, however with the formatter, when selecting “peform math operation” and then multiply. Apparently I cannot subtract in the input fields. Thus when I try to subtract 1 from iteration number, it is always uses the value of the iteration count without subtracting 1. Any idea how I can make it use the subtraction?

 

Userlevel 6
Badge +6

Hey @maor356,

 

What is the value you get on testing this action? Also,Can you try do the subtraction in one action above, and use that value for multiplication in next step. Let me know how it goes. 

 

Userlevel 1

Hi,

 

The value I was getting on testing was 0. But apparently it was the value for all iterations. I did what you said (adding another formatter before for a subtraction calculation, and used that value in the initial formatter), and it worked. It does cost me an extra task, but I guess there is no other way around it. 

 

Thanks for the help :)

Userlevel 7
Badge +9

Hi friends! I wanted to pop in and consolidate some of the responses into a single answer :slight_smile: :

 

Hey, Yes that is possible, You can delay each loop execution with the difference of 40. 
 

Use Formatter by Zapier application and do a simple multiplication. between 40* Count. (You can get count by doing simple mathematical calculation Loop iteration count -1 ) 

 

So for the 1st loop execution it will delay for 0 minutes, for 2nd loop execution it will delay for 40 minutes and so on). The above action will give a number. Paste this number in the next step of Delay by Zapier → Delay For

 

Note - Zapier can hold a Task only for 1 month. You won’t be able to Delay for more than 4 Weeks.

 

To workaround not being able to subtract in the input fields, @jayeshkumarbhatia recommended:

 
do[ing] the subtraction in one action above, and use that value for multiplication in next step