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.'.
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:
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))
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional