cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Power Automate
Power Automate

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
Power Automate
Power Automate

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

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

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!

New Member

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (8,792)