cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Super User III
Super User III

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

Power Automate Video Tutorials
Dual Super User II
Dual Super User II

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!

 

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

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

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

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

Power Automate Video Tutorials

@abm @MattWeston365 i have something like this - 

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

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

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (18,308)