cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Community Support

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
Community Support

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

Resolver III
Resolver III

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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!

Top Solution Authors
Users online (3,389)