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

How to create a date comparison in flow condition

I am getting a List of record from dynamic 365, I am meant to update the records, if a date field is the records is 14 days over the date specified in the field. How Do I add this condition in a flow, I have the below flow, but stuck at the condition now. Someone pls help?

capture.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: How to create a date comparison in flow condition

Hi @onyebuchiboss@yashag2255's screenshot depicts createdon as the name of the field which he's performing the filter on. It needs to be the internal name of the field rather than the display name, so yours could be endtime rather than End Time.

 

If you need to find out what it is, you can refer to the output of the trigger/action where you're using the End Time dynamic content.





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

9 REPLIES 9
Highlighted
Super User III
Super User III

Re: How to create a date comparison in flow condition

Hi @onyebuchiboss ,

 

You need to use the expression in your flow action.

 

utcnow() returns the current date.

To add days to a particular date use adddays(utcnow(), 14).  This will give you todays date + 14 days.

 

This link might be helpful

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Dual Super User III
Dual Super User III

Re: How to create a date comparison in flow condition

Hi @onyebuchiboss 

 

You can refer to @abm 's suggestion for getting the date part sorted. It is a good practice to use this in a filter query to get the iets matching the date criteria for your case. Please see the screenshot below: d1.PNG

Here, I am trying to get the records that were created 14 days ago from now. Expression: 

addDays(utcNow(),-14). 
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Highlighted
Helper II
Helper II

Re: How to create a date comparison in flow condition

in your query, is "Createdon Le" a string or a field from my source ?

Highlighted
Super User
Super User

Re: How to create a date comparison in flow condition

Hi @onyebuchiboss@yashag2255's screenshot depicts createdon as the name of the field which he's performing the filter on. It needs to be the internal name of the field rather than the display name, so yours could be endtime rather than End Time.

 

If you need to find out what it is, you can refer to the output of the trigger/action where you're using the End Time dynamic content.





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

Highlighted
Helper II
Helper II

Re: How to create a date comparison in flow condition

@MattWeston365 is it possible to do something like this in the query: createdon: (>= addDay(),-14). Createdon date equal or greated that 14days ago ?

Highlighted
Super User III
Super User III

Re: How to create a date comparison in flow condition

Hi @onyebuchiboss ,

 

Try createdon ge addDays(createdon,-14)

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Helper II
Helper II

Re: How to create a date comparison in flow condition

@abm @MattWeston365 i have something like this - 

addDays([scheduledend],14).  But its saying wrong expression.
Highlighted
Super User
Super User

Re: How to create a date comparison in flow condition

Hi @onyebuchiboss the reason you're seeing that is because of the "scheduleend" reference in the expression. What it is actually looking for is the definition of where that field is coming from. E.g. if you have that value stored in a variable called "Scheduled End", then you would use the following:

 

addDays(variables('Scheduled End'),14)

 

You can also use the dynamic content selector within your expression if you want to take your value directly from the source action. To do this, start typing your expressing and then switch back to the dynamic content.

AddDays.PNG





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

Highlighted
Helper II
Helper II

Re: How to create a date comparison in flow condition

HI @MattWeston365, the problem is that, the previous action is just a reoccurence, so i cant get the value from the source. Please look at this thread and know more about the flow Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format 

 

cheers

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (2,604)