web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
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:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,980 Super User 2025 Season 2 on at
    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).
  • AH-10012226-0 Profile Picture
    2 on at
    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard