cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Today minus 6 month

I want to check a condition of weather a VariableTime == Today minus 6 month.

How can i do this. Is this possible with utcNow()?

 

Like this way?

reminder.PNG

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

You need to compare Date/Time or only date?

 

If you need only date use this:

 

 

@equals(ticks(concat(formatDateTime(items('Auf_alle_anwenden')?['K_x00fc_ndigungstermin'], 'yyyy-MM-dd'), 'T00:00:00Z')), ticks(concat(formatDateTime(addDays(utcnow(), -180), 'yyyy-MM-dd'), 'T00:00:00Z')))

 

 

You can use compose to see the result of individual parts to confirm the result

 

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

Anonymous
Not applicable

It works!

My condition is shown in the screenshot

 

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

i manipulated your code in the other way

 

x-6.PNG

 

Thank you!!!!!!! It was a hard work for me 😉

 

View solution in original post

6 REPLIES 6
gamoraes
Memorable Member
Memorable Member

Hi @Anonymous

 

To transform utcNow() to minus 6 month use this:

 

 

adddays(utcNow(), -180)

Now, to compare if the column value is greater then date you need to format the two values, i recommend use ticks(), like this:

For today date:

 

ticks(adddays(utcNow(),-180))

 

For column value:

 

ticks(triggerBody()?['NAME OF YOUR COLUMN'])

the final result in condiction in advanced mode should be:

 

 

 

@equals(ticks(triggerBody()?['NAME OF YOUR COLUMN']), ticks(adddays(utcNow(), -180)))

Hope this helps!

 

Best Regards,

 

Gustavo Moraes

 

 

 

 

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Anonymous
Not applicable

I tried this with a column from a sharepoint list. Is a variable necessary?

 

@lessOrEquals(ticks(items('Auf_alle_anwenden')?['K_x00fc_ndigungstermin']), ticks(addDays(utcNow(), -180)))

 

something doesn't work

lessOrEquals is only for testing final should be Equals

You need to compare Date/Time or only date?

 

If you need only date use this:

 

 

@equals(ticks(concat(formatDateTime(items('Auf_alle_anwenden')?['K_x00fc_ndigungstermin'], 'yyyy-MM-dd'), 'T00:00:00Z')), ticks(concat(formatDateTime(addDays(utcnow(), -180), 'yyyy-MM-dd'), 'T00:00:00Z')))

 

 

You can use compose to see the result of individual parts to confirm the result

 

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

Anonymous
Not applicable

It works!

My condition is shown in the screenshot

 

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

i manipulated your code in the other way

 

x-6.PNG

 

Thank you!!!!!!! It was a hard work for me 😉

 

View solution in original post

Hi @Anonymous

 

Very good!!!

 

Only one thing to pay attention, i didn't a hard tests to see if flow compare date as date or as string, if it compare as string  we need use the 'tick'.

 

Thanks @Anonymous 🙂


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Girish-Kalamati
New Member

Cool that helps 🙂

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,117)