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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / MS Planner - Due Date ...
Power Automate
Answered

MS Planner - Due Date and Return Date Calculations

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm using MS planner and have the following for created tasks:

 

Start Date: equal to the date the MS form is submitted)

Due Date: 90 days before the 'Return date' which is a date submitted in the MS Form.

 

This works perfectly well in most cases, but very occasionally when the 'Return Date' submitted on the form is less than 90 days, it causes the flow to fail as the Return Date minus 90 days ends up being before the Start Date (the date the form was created).

 

I had an expression for this, which I've since deleted (and cant remember!). Does anyone have an idea how this might be avoided?

Categories:
I have the same question (0)
  • David- Profile Picture
    1,254 on at

    I think the easiest thing to do would be to calculate the number of days between the start date and due date. Then add a condition to check if the difference is greater than 90 days. Maybe that is the expression you are looking for, as there is no simple datediff expression in Power Automate. You need to calculate the ticks. This post will explain how to do that: dynamics crm - DateDiff() Function in PowerAutomate: Where is it? - Stack Overflow

  • Barking_Mad1 Profile Picture
    on at

    Thanks, unfortunately I'm useless with expressions. Can you help me write the formula? I think I can do the second one, but the first one.....Im not sure how to do this using ticks and SubmissionTime, or should it be utcNow() ?

     

  • Verified answer
    David- Profile Picture
    1,254 on at

    I don't know how I can do any better of a job of explaining than what is in the post I linked to except to give you a screen shot of the actions used for these expressions:

     

    Expression 1 goes into Initialize variable varStartDateTicks: 

    • ticks(triggerBody()?['StartDate'])

    Expression 2 goes into Initialize variable VarEndDateTicks:

    • ticks(triggerBody()?['EndDate'])

    Expression 3 goes into Compose Difference:

    • div(sub(variables('varEndDateTicks'),variables('varStartDateTicks')),864000000000)

    The result will be the difference between the two dates.

    David_0-1658149800689.png

    If you have named everything as above, the only issue you might have are the triggerBody()?['StartDate'] and triggerBody()?['EndDate'] variables as they come from your data source. When building the expression, after you type ticks() switch over to Dynamic content and choose your variable and it will populate into the expression.

  • Barking_Mad1 Profile Picture
    on at

    Thanks for your help, it's really appreciated. Works as intended 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard