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

Need help with Compose action to handle time

Needing help with creating a compose action that handles Flow's UTC time and EST. If the date of an event is less than 3/11/18 or greater than 11/5/17, subtract 5 hours from time of event

 

 

if(or(less(triggerBody()?['EventTime'],'2018-03-11T020:00:01Z'),greaterorEquals(triggerBody()?['EventTime'],'2017-11-05T02:00:01Z'),addhours(triggerBody()?['EventTime'],-5,'f'),addhours(triggerBody()?['EventTime'],-4,'f')))

1 ACCEPTED SOLUTION

Accepted Solutions
Advocate IV
Advocate IV

I've corrected the if statement

 

 

if(and(less(triggerBody()?['EventTime'],'2018-03-11T020:00:01Z'),greaterorEquals(triggerBody()?['EventTime'],'2017-11-05T02:00:01Z')),addhours(triggerBody()?['EventTime'],-5,'f'),addhours(triggerBody()?['EventTime'],-4,'f'))

View solution in original post

3 REPLIES 3
Advocate IV
Advocate IV

I've corrected the if statement

 

 

if(and(less(triggerBody()?['EventTime'],'2018-03-11T020:00:01Z'),greaterorEquals(triggerBody()?['EventTime'],'2017-11-05T02:00:01Z')),addhours(triggerBody()?['EventTime'],-5,'f'),addhours(triggerBody()?['EventTime'],-4,'f'))

View solution in original post

Hi @Grahambo05,

 

The formula you shared should work:

Make sure you have entered it under the Expression part (under Dynamics content Window):

69.PNG

 

Use expressions in Flow actions

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-micsh-msft

 

Yes, it did work. I noticed if you click within an expression sometimes it will disappear forcing me to exit out of the flow without saving in order so I don't lost the compose statement I created.

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

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!

Users online (114,211)