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 array for dates
Power Automate
Answered

Filter array for dates

(0) ShareShare
ReportReport
Posted on by 8

I am trying to create a flow for getting notification when uploaded documents in SharePoint online get expired and i put an expression in filter array is less than "adddays(utcnow(yyyy-MM-dd),0) ,but when i tested it ,error was come 

 

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@less(item()?['Expirationdate'], 'adddays(utcnow(yyyy-MM-dd),1)')' failed: 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

 

 
Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,871 Most Valuable Professional on at

    Hi @Islam209,

     

    It looks like one of the items in your list does not have an expiration date. You can include an empty check in your expression to handle these kind of null values.


    Can you try the expression below:

    @less(if(empty(item()?['Expirationdate']), 'No expiration date', item()?['Expirationdate']), adddays(utcnow('yyyy-MM-dd'), 1))

     

  • David- Profile Picture
    1,254 on at

    I do this a bit differently. I create a scheduled flow with it scheduled to run once per day. I initialize a filter date and then set it to the current date with the expression:

    formatDateTime(utcNow(),'yyyy-MM-dd')

    In the get items action I use the filter date on the expiration date (Notice Date in my example below) to get the items where the expiration date is equal to today:

     

    Web capture_27-6-2022_101026_emea.flow.microsoft.com.jpeg

  • Islam209 Profile Picture
    8 on at

    Thanks @Expiscornovus , this was helpful for me 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard