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

Filter array failed

I was trying to create a flow that sends the contents of a table based on one of the values of the columns. When I try to filter through that column I get the error below. I'm not sure why i'm getting the error since i'm just using a value of 30. Could it be related to the data type im using in my excel?

 

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@greaterOrEquals(item()?['Days since last check'], 30)' failed: 'The template language function 'greaterOrEquals' expects two parameter of matching types. The function was invoked with values of type 'String' and 'Integer' that do not match.'.

 

 

Flow.png

8 REPLIES 8
ccc333ab
Solution Sage
Solution Sage

If you look at the "output" from the Excel file, the array will have a format like "Days Since Last Check" : "30". So the 30 is actually a string. 


So you would need to convert it to an integer. So on the left hand side of your filter, create an expression of:   int(item()?['Days_Since_Last_Check'])

wkolenky
Regular Visitor

 

I still see an error although this time it seems like an error with trying to convert the value. Is it possible to convert it?

 

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@greaterOrEquals(int(item()?['Days_since_last_check']), 30)' failed: 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

ccc333ab
Solution Sage
Solution Sage

Yes, I have done this and just retested again just in case my mind is out to lunch.

 

Just make sure the column name is typed in correctly into the expression. If you can't see any issues, can you do the following and send back to me.

 

1. Image of the condition while hovering over the expression (or just send me the text of the expression).

2. Creat a compose statement and add in the days since last check. Then hover over it and send me what it says. 

Are you talking about hovering over the output like below?

 

wkolenky_0-1623208178318.pngwkolenky_1-1623208242186.png

 

ccc333ab
Solution Sage
Solution Sage

Sorry, I meant filter array, not condition. I'll try to reword what I sent, was in a bit of a rush in my response. 

 

In your filter array, make sure the column name is correct. If you check and can't see what the issue is, can you send me (of note: in screenshots, assume Test1 is Days Since Last check😞 

 

1. Hover over filter array expression and send me screen snapshot. 

ccc333ab_0-1623208748358.png

 

2. Create Compose, and add in the inputs the "Days since last check" and hover over that and send to me. Don't save this, you can just get rid of the Compose after...I just want to see the syntax as you hove over the Days since last check...

ccc333ab_1-1623208843694.png

wkolenky
Regular Visitor

I attached the screenshots below.

 

wkolenky_0-1623209456354.png

 

 

wkolenky_1-1623209460895.png

 

ccc333ab
Solution Sage
Solution Sage

Ok, so remove the underscores I used in the expression. I. E.

 

Int(item()?['Days since last check'])

ccc333ab
Solution Sage
Solution Sage

PS. I had a typo if you're cut and pasting, I missed a bracket at the beginning (um typing on my phone). 

 

Also i have found sometimes when you update an expression it doesn't always save properly. So after you update it, hover over it to make sure your changes took. If not, delete out the expression and just rewrite it. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,353)