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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,353)