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

Compare date - Today and value

Hello!

 

Could you help me out? I am looking for a solution for comparing 2 dates.

Condition

22.03.2017 less or equals [today]

 

@lessOrEquals(item()?['CHECKFROM'], '??????????????')

 

Thank you

6 REPLIES 6
Community Support Team
Community Support Team

Re: Compare date - Today and value

Hi Chs,

 

I configured a flow to send an email when the Date column in the list is less than or equal to Today. My flow configuration looks like below:
6.PNG


Then when an item is created, if the data is less than or equal to Today, an email would be sent.

 

In the SharePoint list, the Date column is Date only format. What’s your data source? If you are also using SharePoint list, please make sure to configure the Date/Time column as Date only format.

 

Please try to configure the Condition with the formula as following:
@lessOrEquals(triggerBody()?['Date'], formatDateTime(utcnow(),'yyyy-MM-dd'))

 

The workflow definition contains the actual logic that executes as a part of your logic app. This includes one or more triggers that initiate the logic app, and one or more actions for the logic app to take. Hope this documentation about Workflow Definition Language could be a reference for you:
https://docs.microsoft.com/en-us/rest/api/logic/definition-language

 

Please try it on your side and let me know if it works for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
westerdaled
Level: Powered On

Re: Compare date - Today and value

Hi

 

 

I have  a  smilar question. I want to calc the next annual date read from a worksheet . However, I am getting error  with this  syntax

 

@equals(item()?adddays(['Last_x0020_Service_x0020_Date'],365) formatDateTime(utcnow(), 'dd-MM-yyyy' ))

Has anybody had a similar issue?

 

Daniel

Grahambo05
Level 8

Re: Compare date - Today and value

@westerdaled

 

have you tried

 

@equals(addays(item()?['Last_x0020_Service_x0020_Date'],365,'d')

Dual Super User
Dual Super User

Re: Compare date - Today and value

I don't think it will work with leap years 😞



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



WDRC
Level 8

Re: Compare date - Today and value

@v-yamao-msftyour expression

 

@lessOrEquals(triggerBody()?['Date'], formatDateTime(utcnow(),'yyyy-MM-dd'))

 

worked for me with a bit of modification for my case, thanks

 

Andrew

WDRC
Level 8

Re: Compare date - Today and value

@v-yamao-msft

 

So I have this flow as below that runs sucessfully:

 

flow pl.png

 

 

This is linked to the below SP list:

 

flow pl.2png.pngThe issue I have is the dates format.  So in the list it is set to a UK format, in the flow this gets converted into a UTC format.  When I use the date field in the email that the flow will send, this also gets inserted in the UTC format.  Is there anyway of modifying this to long format of 5 December 2018 so when it is used in the email it looks better and in the that long format. 

 

Hope you can help.

 

Regards,

 

Andrew

 

 

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

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 Solution Authors
Top Kudoed Authors
Users online (5,676)