cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
King
Advocate III
Advocate III

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
Super User II
Super User II

Hi @King 

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
Super User II
Super User II

Hi @King 

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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Users online (19,124)