Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Reminder E-mail - utcnow or adddays not working

(0) ShareShare
ReportReport
Posted on by

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.

 

  • Bijan Profile Picture
    Bijan 2 on at
    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

     

  • TravisB Profile Picture
    TravisB on at
    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!

  • 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

  • Verified answer
    TravisB Profile Picture
    TravisB on at
    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')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard

Featured topics