cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jinivthakkar
Super User
Super User

Add hours to modified column

Hi All,

 

I have a SharePoint list in which different travel request are submitted and if request is not approved in two hours I need to send reminder email but I just can't get the formula to add hours right.

 

I am getting this value from modified column - 2020-11-17T12:53:23Z and I just need to add two hours and need formula for the same.

 

I have three level of approvals, if request approved at level 1 then check if level approved at level 2 in the next 4 hours else send reminder email, if request not approved in next 8 hours need to send another reminder email and so.

 

Hence I need to add 2,4,8 hours to modified column of SharePoint list

 

Please help

 

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Super User
Super User

I did get item, then initalize variable and then in set variable I added this expression :

 

addHours(outputs('Get_item')?['body/Modified'],+1)
 
 

View solution in original post

4 REPLIES 4
tom_riha
Super User
Super User

Hello @jinivthakkar ,

there's addHours() expression in Power Automate, you'll use the modified date as the first parameter and the 2nd parameter is how many hours you'd like to add (2 or 4 or 8...)

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Hi Tom, 

 

I am aware of the addHours() function and I also tried using it but it keeps giving me error - Invalid expression

 

So I need help in building the expression which addes 2,4 etc hours to modified column.

 

Thanks !

Hello @jinivthakkar,

the expression should have the following format, 

addHours(<ModifiedDate>,2)

addHours(<ModifiedDate>,4)

addHours(<ModifiedDate>,8)

 <ModifiedDate> is the 'Modified' dynamic content.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
jinivthakkar
Super User
Super User

I did get item, then initalize variable and then in set variable I added this expression :

 

addHours(outputs('Get_item')?['body/Modified'],+1)
 
 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,532)