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

Date field is within 1 month of current date

I have a condition where I check if a date field is between (Today-30 days) and (Today).

Hello,

 

I have the below conditions:

- formatDateTime(item()?['Negotiation_x0020_date'],'dd/MM/yyyy') is greater than or equal to 
formatDateTime(item()?['Today_x0020__x002d__x0020_30_x00'],'dd/MM/yyyy')
- formatDateTime(item()?['Negotiation_x0020_date'],'dd/MM/yyyy') is less than or equal to 
formatDateTime(item()?['Today'],'dd/MM/yyyy')
I have an item which meets these conditions, but the result is false.
I can't figure it out what am I doing wrong.
Paula.PNG
 
Thank you,
Paula
 
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Date field is within 1 month of current date

Hi @Delpierita ,

 

What’s the column type of “Today_x0020__x002d__x0020_30_x00”? I assume that it is a calculated column in the list.

 

For your scenario, if you would like to check if a date field is between Today-30 days and Today, please try to use adddays function instead of using a calculated date from the list.

 

The functions in the Condition are:

 

formatDateTime(items('Apply_to_each')?['Date'],'yyyy-MM-dd')

is greater than or equal to

formatDateTime(addDays(utcNow(),-30),'yyyy-MM-dd')

And

formatDateTime(items('Apply_to_each')?['Date'],'dd/MM/yyyy')

is less than or equal to

formatDateTime(utcNow(),'yyyy-MM-dd')

 

A screen shot for the flow:

1.PNG

 

Best regards,

Mabel

 

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.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Date field is within 1 month of current date

Hi @Delpierita ,

 

What’s the column type of “Today_x0020__x002d__x0020_30_x00”? I assume that it is a calculated column in the list.

 

For your scenario, if you would like to check if a date field is between Today-30 days and Today, please try to use adddays function instead of using a calculated date from the list.

 

The functions in the Condition are:

 

formatDateTime(items('Apply_to_each')?['Date'],'yyyy-MM-dd')

is greater than or equal to

formatDateTime(addDays(utcNow(),-30),'yyyy-MM-dd')

And

formatDateTime(items('Apply_to_each')?['Date'],'dd/MM/yyyy')

is less than or equal to

formatDateTime(utcNow(),'yyyy-MM-dd')

 

A screen shot for the flow:

1.PNG

 

Best regards,

Mabel

 

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.

View solution in original post

Willemijn
Level 8

Re: Date field is within 1 month of current date

Hi, 

 

I think you're equation should be something like:

formatDateTime(triggerBody()?['Negotiaton_x0020_date'],'dd-MM-yyyy') is greater or equal to 
formatDateTime(addDays(utcNow(),-30),'dd-MM-yyyy')
and 

formatDateTime(triggerBody()?['Negotiaton_x0020_date'],'dd-MM-yyyy') is less or equal to formatDateTime(utcNow(),'dd-MM-yyyy')

 

utcnow() is the 'today' in Flow, and with addDays() you can add or substract days from you're chosen date. 

 

Hope this helps

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,539)