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

Round-trip date/time

My below expression does not match round-trip date/time:
 
addDays(body('FUTUREUSE'), -30, 'yyyy-MM-ddThh:mm:ssZ')
Lauren__0-1618837105642.pngLauren__1-1618837116001.png

 

The 'timestamp' value of the 'Wait' action 'until' inputs must be specified in UTC using the round-trip date/time pattern (for example, '2015-10-22T10:00:00Z'). For details please review the Standard Date and Time Format Strings of the .Net framework.
 
Can you please advise how I get this to function?
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi there, so as I understood the error comes when you try to wait until the specific time?

Try to wrap the addDays function into a formattime, then it should work!

I tried it out without the formatting and I got the same issue which disappeared when formatting it.

 

formatDateTime(addDays(variables('Time'),-30),'yyyy-MM-ddThh:mm:ssZ')
 
powercorner_0-1618863793566.png

 

 
With regards
Kevin

View solution in original post

7 REPLIES 7
manuelstgomes
Super User II
Super User II

Hi @Lauren_ 

 

Can you please detail a little bit further what you're trying to achieve so that I can try to help you?

 

If you're looking for more details in how to use this function I go into detail about how to use it here:

https://manueltgomes.com/reference/powerautomate-function-reference/flow-adddays-function/

 

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi Manuel, sure thing 🙂 The user selects a date that they want to look at something again (see 'FUTUREUSE' time convertor) and I am trying to set it up to remind them 30 days prior to that date. FutureUseReminder is a calculation to take the date that the user submitted and take 30 days away from it.

manuelstgomes
Super User II
Super User II

Hi @Lauren_ 

 

OK I think I got it but let's go step by step.

 

I did the following Flow to simulate what I think you need. I'm getting the current date/time and getting the calculation of 30 days prior.

2021-04-19 17_35_56-Edit your flow _ Power Automate - Brave.png

 

I use the following formula:

 

addDays(variables('FUTUREUSE'),-30)

 

 

And get.

2021-04-19 17_35_47-Run History _ Power Automate - Brave.png

 

What's missing to match exactly what you need?

 

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi Manuel, thanks for replying! 


I'm doing this within a condition and it won't let me set up a variable within. I've set up the variable before the condition that uses it and set a 'wait' function on the compose output, and it still fails.

 

Lauren__0-1618856492491.png

Lauren__1-1618856521014.pngLauren__2-1618856527972.png

Lauren__3-1618856548410.png

 

 

Hi there, so as I understood the error comes when you try to wait until the specific time?

Try to wrap the addDays function into a formattime, then it should work!

I tried it out without the formatting and I got the same issue which disappeared when formatting it.

 

formatDateTime(addDays(variables('Time'),-30),'yyyy-MM-ddThh:mm:ssZ')
 
powercorner_0-1618863793566.png

 

 
With regards
Kevin

View solution in original post

powercorner
Advocate I
Advocate I

but I see another problem in your approach. when the waiting time exceeds 30 days the workflow will be cancled!

so maybe you should set a column on your item (status: waiting) and let a flow check every day if the time is there to inform or do the steps 30 days before the date. 

 

I think you need to change your structure of how you solve your usecase.

Hi Kevin, your suggestion has worked! I figured if I couldn't calculate it in the Power Automate I'd have to calculate and capture it in the list 🙂

Helpful resources

Announcements
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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (52,066)