web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Delay loop with Apply ...
Power Automate
Unanswered

Delay loop with Apply to each

(0) ShareShare
ReportReport
Posted on by 10

I am trying to create a flow that checks if the date someone put as returning is equal to today and then if so delay it by 1 day before sending an email. However since there are multiple responses there are occasions where two people return on the same day. The Apply to each function has interacted with the Delay funtion in an unexpected way and is looping the delay. It recognises that the date is the return date then delays by a day, sends one email. Then delays by a day again before sending the second email. How would I prevent the delay occuring twice as i want both emails to send after just one day of delay.

Flo6_0-1675256079602.png

Flo6_1-1675256109143.png

 

Categories:
I have the same question (0)
  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Since this is a scheduled flow, is there a reason you could not just check if the Return Date was yesterday and send an email now? Seems like it would be the same except skip the need for a delay step.

  • Flo6 Profile Picture
    10 on at

    I wasnt sure of how to check for any day other than the uctNow. What would be the formula for yesterday?

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    You need to add a negative -1 day to today's date to get yesterday. If you use the addDays() expression you can add or subtract days from a date.

    https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#addDays 

     

    addDays(utcNow(),-1)

     

    Let me know if this works for you

  • Flo6 Profile Picture
    10 on at

    It worked as far as pulling through yesterday but wasnt recognising a match for the return date as it pulled through the time as well is there any way to not have the time?

    Flo6_0-1675265526464.png

     

  • Verified answer
    wskinnermctc Profile Picture
    6,519 Moderator on at

    You'll need to formatDateTime(<timestamp>,'MM-dd-yyyy') for both of the values and then compare them.

     

    Or you could do the format within the addDays() step.

    addDays(utcNow(),-1,'MM-dd-yyyy')

     

    Then you will be comparing "MM-dd-yyyy" to another "MM-dd-yyyy"

  • Flo6 Profile Picture
    10 on at

    Thats worked perfectly thank you so much for the help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard