Hello,
I want to create document expiration notifications as shown in this video. I am having trouble with the filtering of the data as it keeps saying I'm comparing a null against a string despite both of them assumingly being dates. Here is the exact error code I am receiving:
"The execution of template action 'Filter_array_2' failed: The evaluation of 'query' action 'where' expression '@less(item()?['ExpirationDate'], addDays(utcNow(), 0, 'yyyy-MM-dd'))' 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 have been troubleshooting this issue and when I input a set value for the expiration date it runs fine but gives no output in the email. Below I've shown some of the flow and what it looks like when it succeeds and fails.
This is what the pulling and filtering of the data looks like in the flow based on the tutorial:
This is where the flow fails:
This is what it looked like when I replaced the expiration date data with a set string.
This is what the SharePoint structure looks like for what I am doing. The expiration date is simply a column added in date format:
If anyone could advise me as to where I should be starting to address this issue, I would be greatly appreciative.
Thank you,
MBB
Hello @mbowen ,
are you using the internal name of the column to reference it?
item()?['<ExpirationDateInternalName>']
Thank you for your response!
To reference the column I simply used the dynamic value of the same name. Should I switch it?
I ended up solving this issue by specifying the folder as one of them was empty and returning a null. Now I have a problem of the email sent out not actually listing the expired documents.
Hi @mbowen ,
Can you please ensure that while you are comparing the dates , formats of both are same i.e. dd/MM/yyyy or yyyy-MM-dd
Thanks
Hello!
From what I can tell, every date within the inputs is formatted as yyy-MM-dd which is what I have my expression for today's date set to.
for any row in Sharepoint you have null or blank value as Expiration Date ? If that is the case then filter that out first and then do the processing on the remaining records
Thanks
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
User | Count |
---|---|
32 | |
31 | |
24 | |
24 | |
20 |
User | Count |
---|---|
60 | |
57 | |
43 | |
37 | |
28 |