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

Community site session details

Session Id : d4uaoIkzegLyo8QlRvGgpF
Power Automate - Building Flows
Unanswered

Power Automate Get Corresponding Date

Like (0) ShareShare
ReportReport
Posted on 15 Jun 2022 07:35:00 by

Hello,

 

I am trying to build a flow in Power Automate. I have listed a row from Excel so far, which has a date in one of its column. My goal is to find next or second next Monday of this date in 2-week intervals. For example, if my 2-week intervals are on June 19th-July 2nd, July 3rd-16th, and July 17th-30th, the result should be starting day of the interval. For example. if the date is today, it should give me June 19th, if it is June 20th, it should give me July 3rd.

 

How can I build this in Power Automate by using which operation?

I have the same question (0)
  • eliotcole Profile Picture
    4,343 Moderator on 15 Jun 2022 at 10:26:27
    Re: Power Automate Get Corresponding Date
    1. Initialize a String variable action called mondayOneVAR with the utcNow() expression inside it OR place a Current time action before it and use that in mondayOneVAR
      utcNow()
    2. Create a Do until action which has in the left side formatDateTime(variables('mondayOneVAR'), 'ddd') with the condition 'is equal to' and in the right side Type Mon
      formatDateTime(variables('mondayOneVAR'), 'ddd')
    3. Place an Add to time action as the first action in the Do until and ensure Base time is mondayOneVAR, interval is 1, and 'Time unit' is "Day"
    4. Place a Set variable action after the Add to time action inside the Do until and use the calculated time from that Add to time to set the variableCongratulations, that has set your first Monday!
    5. After the Do until loop place a second Add to time action (this will autoname to Add to time 2) and duplicate what you did in the first one, but instead of day make it week.
    6. Initialize a second String variable action called mondayTwoVAR and place the calculated time from Add to time 2

    Now you have next monday in mondayOneVAR, and the monday afterwards in mondayTwoVAR.

     

    Important: Do not format the date/time in the monday variables, do it wherever you use that value, this means that they stay in their most usable format for everything.

    timeFlow.jpg

     

    It's possible to take a couple of steps out of this using more expressions, but that's more advanced. This should do you, @Anonymous . 🙂

  • Community Power Platform Member Profile Picture
    on 17 Jun 2022 at 06:45:38
    Re: Power Automate Get Corresponding Date

    Hii @eliotcole, thanks for your response. I have accidentally misexplained myself. My aim is not to reach both of the Mondays actually. I want to get the first Monday of a 2-week interval. So, it should give me one of the next Monday or the second next Monday depends on the current day, instead of giving two days.

  • Community Power Platform Member Profile Picture
    on 17 Jun 2022 at 07:07:09
    Re: Power Automate Get Corresponding Date

    I also realized that I can only use the 'Initialize variable' operation on the top level. Since my flow includes some condition operations I cannot use that action in my flow. Is there another way to do it ? 😞

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard
Loading complete