cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Grahambo05
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
Grahambo05
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
Grahambo05
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
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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,976)