cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
msalamonjl
Helper I
Helper I

Delay Until in a Loop

I have a flow that needs to run late at night. It gathers information from various data sources, organized by recipient, and then emails each recipient a summary of the information that is applicable to them.

However, I don't want these emails to be sent until the next morning (or if run on a Friday night, the emails would not be sent until Monday morning).

I was hoping to use Delay Until for this, but the problem is that processing this information occurs in a loop, looping through each recipient.  The flow gathers info for Recipient1 then sends the email to Recipient1, then onto Recipient2, etc.

If I include the Delay Until action before the send email action, that pauses the entire flow. 

I could refactor my flow to collect all of the information to be sent to each recipient, say in an array of json objects [{"Recipient":"emailaddress1","EmailBody":"body1"},{"Recipient":"emailaddress2","EmailBody":"body2"},...], and then add the Do Until before a loop that loops through the information that has been collected and sends the emails, but that seems inelegant.

Is there any way to configure the Delay Until so that only the next action is delayed but the loop continues?  Almost like separate threads.

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @msalamonjl 

 

You need to redesign the flow. You can't delay and continue next action in a loop.  

 

You may need two flows to do this.

 

Create a flow to collect the recipients name and day to send email. If it's Friday then set to Monday. Store this info in a database or a list (SharePoint ) or Excel. Then create another new flow scheduled to run every day to look for the db and sent the email.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

1 REPLY 1
abm
Super User
Super User

Hi @msalamonjl 

 

You need to redesign the flow. You can't delay and continue next action in a loop.  

 

You may need two flows to do this.

 

Create a flow to collect the recipients name and day to send email. If it's Friday then set to Monday. Store this info in a database or a list (SharePoint ) or Excel. Then create another new flow scheduled to run every day to look for the db and sent the email.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,983)