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 Platform Community / Forums / Power Automate / Filter array for dates
Power Automate
Unanswered

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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard