cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Reminder E-mail - utcnow or adddays not working

Hi

 

I am trying to set up a flow to send a reminder e-mail whenever a specific date is coming up, I have set the flow to run on a recurrence, get list items from sharepoint and then send an email if a condition is filled. The condition, written in advanced mode, is: @equals(item()?['Next_x0020_Wipe_x0020_Due'], 'adddays(utcnow(yyyy-MM-dd),1)')

I have tried using "triggerBody" instead of "item" but that also doesn't work.

 

I have tried this today (the 28th) and the "Get Items" step comes back with:

 

Which is, what I thought, the right form to compare to the utcnow / addays

However the flow comes back saying:

 

And this is the same for all rows in that SP list.

 

Note: I have also tried not using the adddays function and setting up another column in the SP list that acts as a reminder date but this date comes through in the format MM/dd/yyyy 23:00:00, which I was having just as much trouble trying to fix.

 

If anyone has any suggestions they would be greatly appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Automate
Power Automate

Re: Reminder E-mail - utcnow or adddays not working

Hi @Anonymous

 

Can you try changing

 

'adddays(utcnow(yyyy-MM-dd),1)'

 

to 

 

adddays(utcnow('yyyy-MM-dd'),1)

 

It looks like you might be comparing the text '2016-12-29' from the parameter with the literal text 'adddays(utcnow(yyyy-MM-dd)'.

 

Hope that helps!

 

-Travis

 

EDIT:

 

It looks like adddays' default ouput format is in the ISO 8601 format (yyyy-MM-ddThh:mm:ssZ), so even with the above change the flow will still fail.

In order to fix the formatting, you will need to take advantage of addDays' optional third parameter which specifies the output formatting.

 

So the total expression will be:

adddays(utcnow('yyyy-MM-dd'),1, 'yyyy-MM-dd')

 

which you can shorten to 

 

adddays(utcnow(),1, 'yyyy-MM-dd')

View solution in original post

4 REPLIES 4
Highlighted
Power Automate
Power Automate

Re: Reminder E-mail - utcnow or adddays not working

Hi @Anonymous

 

Can you try changing

 

'adddays(utcnow(yyyy-MM-dd),1)'

 

to 

 

adddays(utcnow('yyyy-MM-dd'),1)

 

It looks like you might be comparing the text '2016-12-29' from the parameter with the literal text 'adddays(utcnow(yyyy-MM-dd)'.

 

Hope that helps!

 

-Travis

 

EDIT:

 

It looks like adddays' default ouput format is in the ISO 8601 format (yyyy-MM-ddThh:mm:ssZ), so even with the above change the flow will still fail.

In order to fix the formatting, you will need to take advantage of addDays' optional third parameter which specifies the output formatting.

 

So the total expression will be:

adddays(utcnow('yyyy-MM-dd'),1, 'yyyy-MM-dd')

 

which you can shorten to 

 

adddays(utcnow(),1, 'yyyy-MM-dd')

View solution in original post

Anonymous
Not applicable

Re: Reminder E-mail - utcnow or adddays not working

Thank you so much.

 

Annoying that it was such a simple fix to something I've been working on for ages, but this worked perfectly.

 

Thanks again

Highlighted
Power Automate
Power Automate

Re: Reminder E-mail - utcnow or adddays not working

Glad I could help!

 

I agree, debugging complex queries right now is pretty tough.

 

We have a feature on the way that will make it easier to debug things like this by letting you output from your queries. So in this case, we could have output the left and right sides and seen visually why they weren't lining up. I'm looking forward to this feature too!

Highlighted
New Member

Re: Reminder E-mail - utcnow or adddays not working

I too had a similar issue and looked in Logic Apps documentaion (link below) but this was exactly what I needed!

Thanks for your post PIC and the solution offered by TravisB 

https://docs.microsoft.com/en-us/rest/api/logic/actions-and-triggers#conditions

 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

Users online (4,633)