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

condition evaluating a date field

I have a string type field that saves a date with the following format

January 5, 2020 9:21 PM

I want to evaluate the following

If the field date is equal to the field date minus 30 minutes

I know it is done in an expression, but I have no idea how to do it.

 

all this with the aim of sending a notification 30 minutes before that date

1 ACCEPTED SOLUTION

Accepted Solutions
Jay-Encodian
Community Champion
Community Champion

Hi @Anonymous 

This is the expression to parse the string to ISO 8601 format (yyyy-MM-ddThh:mm:ssZ): formatDateTime('January 22, 2020 9:21 PM','yyyy-MM-ddTHH:mm:ssZ')

You can then add required minutes to the datetime value: addMinutes(formatDateTime('January 22, 2020 9:21 PM','yyyy-MM-ddTHH:mm:ssZ'),-30)

Example using the above expressions with the Compose action:

1.png

Ref date comparison... it's a little hard to advise as I don't follow your logic, it's impossible for a value to be equal to itself minus a value?!? 🙂

I'm guessing you would compare against another datetime value or the current time (utcNow())...

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up

 

View solution in original post

1 REPLY 1
Jay-Encodian
Community Champion
Community Champion

Hi @Anonymous 

This is the expression to parse the string to ISO 8601 format (yyyy-MM-ddThh:mm:ssZ): formatDateTime('January 22, 2020 9:21 PM','yyyy-MM-ddTHH:mm:ssZ')

You can then add required minutes to the datetime value: addMinutes(formatDateTime('January 22, 2020 9:21 PM','yyyy-MM-ddTHH:mm:ssZ'),-30)

Example using the above expressions with the Compose action:

1.png

Ref date comparison... it's a little hard to advise as I don't follow your logic, it's impossible for a value to be equal to itself minus a value?!? 🙂

I'm guessing you would compare against another datetime value or the current time (utcNow())...

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,371)