Hi,
I have an approval flow that is running and I have used the addDays function to send a follow up email 30 days after the the flow has finished running.
addDays('2018-06-11T10:00:00Z, 30)
My Question:
Is there a way to insert a field for Now instead of an actual date and time? My problem is, this works great for today, but what happens when I run this flow a month from now? It will already be 30 days past the time it ran (according to formatting as it stands today). How do I subsitute the '2018-06-11T10:10:00Z for today's date?
Thanks!
Kathy
Solved! Go to Solution.
Hi @kmason,
You could use the expression below to achieve your needs:
addDays(utcNow(),30)
Thanks Alice, I am going to try that to see how that works.
I appreciate the help.
Hello, @kmason !
Have you had a chance to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
Hi @kmason
If you want to use the current date and time, or just the current date, you can use the utcNow() function. The only thing you need to keep in mind is that the date and time will be in UTC and you have to adjust it to your current time zone. I think the simplest way is to use the Date Time - Convert time zone action. In the Base time field, you can add the utcNow() function from the Expression tab. In the Source time zone dropdown, select (UTC) Coordinated Universal Time. In the Destination time zone, select your time zone. And in the Format string, you can either select a pre-defined format or enter a custom one by selecting Enter custom value.
Once yout get the output from the step above, you can then work on the addDays() to add the 30 days as needed. Please check out the screenshot below for an example, and let us know if you have any questions.
Regards,
Proud to be a Flownaut!
Hi @kmason,
You could use the expression below to achieve your needs:
addDays(utcNow(),30)
Thanks Alice, I am going to try that to see how that works.
I appreciate the help.
Hello, @kmason !
Have you had a chance to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
@faustocapellanj how do you add days in coverted time zone?
Hi @Anonymous
After you do your Convert Time Zone action, you can do the addDays() with the output from the Convert Time Zone in subsequent actions by building the expression below:
addDays(body('Convert_time_zone'), 30)
I hope this answers your question.
Proud to be a Flownaut!
User | Count |
---|---|
38 | |
36 | |
15 | |
13 | |
12 |
User | Count |
---|---|
23 | |
20 | |
18 | |
13 | |
13 |