Skip to main content

Notifications

Power Automate - General Discussion
Suggested answer

Add Days Not Working

(0) ShareShare
ReportReport
Posted on by 2
I think I've read just about every forum posting on here regarding the Add Days command for Conditions, and I'm still lost. I think I'm super close to having this nailed down but need a someone to look over what I'm doing wrong. 
 
Here's an example of what my Excel table looks like: 
 
 
As you can see, I've set up conditional formatting to highlight any Expiration Dates that are within 45 days in yellow, and any that are past the expiration date in red. 
 
Now, I'm trying to set up a flow that will send an email when the expiration date is 45 days out. This is what I have:
 
 
Here are the Condition parameters:
 
 
 
 
The error I get is this when testing.
 
"Action 'Condition_2' failed: Unable to process template language expressions for action 'Condition_2' at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '45688' was not valid. The datetime string must match ISO 8601 format.'.
 
You can see I have my dates in ISO 8601 formatting in the spreadsheet. I'm so lost on how to fix this and I'm running out of time before my next meeting to have it working appropriately. Help!
Categories:
  • AH-10012226-0 Profile Picture
    AH-10012226-0 2 on at
    Add Days Not Working
    Thanks David for your help! I applied the changes you suggested and I got another error, unfortunately. But I think I taste victory here! Can you help me figure out what the heck is wrong now?
     

    Action 'List_rows_present_in_a_table_2' failed: There is an unterminated string literal at position 23 in 'Reminder eq '2025-02-27'. inner exception: There is an unterminated string literal at position 23 in 'Reminder eq '2025-02-27'. clientRequestId: 18ad1873-db39-40c4-8127-3490f31de14f
  • Suggested answer
    David_MA Profile Picture
    David_MA 9,039 on at
    Add Days Not Working
    First, don't use a condition to check every row returned to see if it meets your date requirement. Instead, use a filter query on the List rows present in a table action so it only returns rows meeting your criteria to begin with. This is much more efficient, and your flow will run faster.
     
    Set the filter up like this.
    This is the expression used in the Filter Query: formatDateTime(addDays(utcNow(),90),'yyyy-MM-dd'). Be sure the ISO 8601 date format is selected. Then the only thing you will need in the Apply to each action is your e-mail action.
     
    Note, this will require you to update the column title in your Excel spreadsheet to not have any spaces in the field name (i.e., ExpirationDate).

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,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard