cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

How to compare dates in the condition

Hi All, 

I am getting the list of records in dynamics and comparing dates (end date >= enddate(+14)) in the condition before updating records in the results. But I am having problems adding 14 dyas to the end dates in the condition. I have seen other solutions on here, but i cant not find the end date field when i try to create a function in the second date to add 14days to it.  Please look at the image below:capture.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: How to compare dates in the condition

Hi @onyebuchiboss 

 

You would have to use expressions

 

Try 

addDays(items('Apply_to_each')?['columname'],14)
 
columname - name of column to aldd 14 days to
in your case "EndTime" - check internal name
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User
Dual Super User

Re: How to compare dates in the condition

Hi @onyebuchiboss 

 

You would have to use expressions

 

Try 

addDays(items('Apply_to_each')?['columname'],14)
 
columname - name of column to aldd 14 days to
in your case "EndTime" - check internal name
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Highlighted
Helper II
Helper II

Re: How to compare dates in the condition

Hi @RezaDorrani, the requirement is to update all record 14days after endtime(datefield). Do you think your solution would filter the records based on the requirement I just stated?
Highlighted
Dual Super User
Dual Super User

Re: How to compare dates in the condition

Hi @onyebuchiboss 

 

For that you would have to do a date comparison using ticks function in Flow

 

Here is a blog post that explains the ticks function and date comparison

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Flow-Calculate-Date-Diference/ba-p...

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Helper II
Helper II

Re: How to compare dates in the condition

@Reza, this worked. i had the following in my condition 

UTCNOW()  >= addDays(items('Apply_to_each')?['columname'],14).

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,731)