How to check if a date is between two dates in Power Automate

Fredrik Engseth
3 min readOct 13, 2021

This post shows an example of how you can check if a date is less than or more than a specific date or within a time period.

A sample use case can be for instance a to check if a case must be followed up in between a time period, a start and end date. For instance when a case is created in Dynamics 365 and you have an SLA that the case must be responded to within a time period. Than you can check on the created date and a deadline for the response. If it’s overdue a notification can be sent to the service user.

How the flow works

The flow consists of thee variables startDate, endDate and currentDate. Each of the variables is set with different date values.

Step 1
In the startDate variable I use an expression that subtract 5 days from the current date to simulate a start date.

addDays(utcNow(),-5).

Step 2
In the endDate variable I use an expression that adds 5 days from the current date to simulate an end date.

addDays(utcNow(),5)

Step 3
In the currentDate variable I use an expression to get todays date.

utcNow()

--

--

Fredrik Engseth
Fredrik Engseth

Written by Fredrik Engseth

Developer | Dynamics 365 | Power Platform | Azure | Personal development | Investments | ☕ https://www.buymeacoffee.com/fredrikengseth

No responses yet