cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shanemeisner Resolver II
Resolver II

Add Numbers of days to date field

We want to set a Flow to send out emails to have people requalify on certain dates. Every Qualification has different time frames.. Some are 6 months, others are 12, 24, etc..

I have been able to get a calculated field to show the number of days before renewal.

What I am having problems with is setting the "Renewal Date" field to be Today * the renewal days.

So, if Renewal days is 180, need to set "Renewal Date" to be 180 days out from today.

I tried setting the "Renewal Date" to something as simple as: adddays(utcnow(),RenewDays, 'yyyy-MM-dd') .. which, as expected failed..

Tried different combination of: @equals(formatDateTime(addDays(utcNow(), int(item()?['RenewDays'])), 'yyyy-MM-dd')) with the same failed results...
Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft Solution Sage
Solution Sage

Re: Add Numbers of days to date field

Hi @shanemeisner ,

It seems you want to add Numbers of days to  today.

I have made a flow for your scenario, please check it for a reference.

Expression in Compose: 

addDays(utcNow(),int(triggerBody()?['RenewDays']),'yyyy-MM-dd')

Capture1.PNG

Capture2.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Add Numbers of days to date field

You're right to use the addDays date and time function, which should be formatted like so:

addDays('<timestamp>', <days>, '<format>'?)

So for your usage, it would be something like:

formatDateTime(addDays(utcNow(),180), 'yyyy-MM-dd')

You can't pass variables to date/time, you need to utilize the Compose action and use it's Output. So, you would have a compose action for each date variation needed. Example:

68.PNG

Please review the following:

If you could provide an expanded screenshot of your Flow and steps, and of any detailed error messages you're receiving we could likely better assist you.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-zhos-msft Solution Sage
Solution Sage

Re: Add Numbers of days to date field

Hi @shanemeisner ,

It seems you want to add Numbers of days to  today.

I have made a flow for your scenario, please check it for a reference.

Expression in Compose: 

addDays(utcNow(),int(triggerBody()?['RenewDays']),'yyyy-MM-dd')

Capture1.PNG

Capture2.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

shanemeisner Resolver II
Resolver II

Re: Add Numbers of days to date field

Thanks for the help.. The formula for the compose function was exactly what I needed!!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,596)