cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mbowen
Regular Visitor

Filter array pulling null value

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:

Flow.png

 

This is where the flow fails:

Failed run.png

 

This is what it looked like when I replaced the expiration date data with a set string.

Successful run.png

 

This is what the SharePoint structure looks like for what I am doing. The expiration date is simply a column added in date format:

sharepoint.png

 

If anyone could advise me as to where I should be starting to address this issue, I would be greatly appreciative.

 

Thank you,

MBB

5 REPLIES 5
tom_riha
Super User
Super User

Hello @mbowen ,

are you using the internal name of the column to reference it?

item()?['<ExpirationDateInternalName>']


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

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.

thumbnail_image001.png

 

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!

 

correct date.png

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

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (2,485)