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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / filter for dates older...
Power Automate
Unanswered

filter for dates older than today

(0) ShareShare
ReportReport
Posted on by 8
I believe I have the rest of the flow set up correctly, and it is sending the emails formatted the way I want them to be. The last issue (hopefully) that I am stuck on is that it sends an email for every vendor in the Excel table. Based on copilot the formula being used to filter the dates is: formatDateTime(addDays(utcNow(), -1), 'yyyy-MM-dd'). The excel file is setup for the yyyy-MM-dd format
 
Also, I'd like to change the date format in the body of the email so it only displays MM/DD/YYYY or it can stay as yyyy-MM-dd. Not sure if one would be easier than the other, I just want the time portion removed (See email attachment)
 
Please help!! TIA.
filter by date.jpg
email_4.jpg
Cert Expiring.jpg
Categories:
I have the same question (0)
  • David_MA Profile Picture
    14,546 Super User 2026 Season 1 on at
    Your post says you want to find dates older than today. However. the expression shows you are looking for dates that are less than the current date less 1 day (less than yesterday):
    I can spot at least two issues with this filter query, aside from whether you want to check for lt (less than) or gt (greater than):
    1. Cert Expiration is not a valid field name for a filter query. How can I tell? It contains a space. Filter queries use the internal name of the field and not the display name. You can get the internal name by going to your list settings and clicking on the field. The internal name is displayed at the end of the URL.
    2. If the expression for the date in the filter query is  formatDateTime(addDays(utcNow(), -1), 'yyyy-MM-dd'), that is the correct format. Filter queries must use an ISO8601 formatted date. However, you need to enclose the expression in single quotes in the filter query. Without the quotes, it considers the value a number.
     
    I need to head to a meeting and will try to remember to follow up later. But hopefully this helps. Note: use the formatDateTime expression to format the date in the e-mail to any format you desire.
  • RD-08041721-0 Profile Picture
    8 on at
    Thanks, David MA I'll play around with it based on your reply. What are you referring to when you say "You can get the internal name by going to your list settings and clicking on the field. The internal name is displayed at the end of the URL."

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard