cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
onyebuchiboss
Level: Powered On

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
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!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

9 REPLIES 9
Highlighted
Super User
Super User

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!



Dual Super User
Dual Super User

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!

 

onyebuchiboss
Level: Powered On

Re: How to create a date comparison in flow condition

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

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!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

onyebuchiboss
Level: Powered On

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 ?

Super User
Super User

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!



onyebuchiboss
Level: Powered On

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.
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!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

onyebuchiboss
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,156)