I've found this thread discussing a similar need (i mean if it is to calculate time difference between two dates). It's from June, so not sure if there is any available improvement since then
Please note some weeks ago a very useful method to calculate time difference was detailed here, based on ticks() function:
But if you need to add/substract days instead of time difference between two dates, you have addDays() function (see the link in my first post for more info)
Hope this helps
Do you use subtractFromTime() function within expression in Microsoft Flow?
The subtractFromTime() function substract an integer number of a specified unit of time from a string timestamp passed.
The first parameter of subtractFromTime() function requires a string timestamp. The second parameter requires the number of a specified time unit to subtract. The third parameter requires the unit of time specified in the interval to subtract. The forth parameter is optional, which is used to specify time format.
I have made a test on my side and the flow works well. My flow’s configuration as below:
The flow works successfully as below:
Sorry I didn't know in MS Flow you can use functions other than the ones defined in WDL. I will open an independent thread to ask for documentation on these extra funcions.
Thanks for sharing and also for your excellent support!
I have used this in a couple of different flows and this is the correct syntax if you want to take a certain number of days away from a desired time:
subtractFromTime(utcNow(), 7, 'Day')
This would take today's date and subtract 7 days from it. I hope this helps.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
If you are a small business ISV/Reseller, share your thoughts with our research team.