cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oskarkuus
Post Prodigy
Post Prodigy

How to use Filter Array multiple times to filter down a sharepoint list?

i want to use filter arrays to filter a sharepoint list.

I need to filter with the condition "CONTAINS" that i can use in filter array.

 

But how do i use multiple filter arrays or how do i type OR in them?

 

I dont understand the syntax atall

 

I have 3 columns i want to filter on.

Column A, B, C

filter them like this

filter(A contains VALUE or B contains VALUE or C contains VALUE, print out the remaining result)

6 REPLIES 6
Pstork1
Dual Super User III
Dual Super User III

Just add an @or() to the outside of your filter and then add additional conditions.  For example I have an array that contains a number of cost center codes.  Here's a filter statement that will return both codes 0550 and 0650.

@or(equals(item()?['CostCenter'], '0650'),equals(item()?['CostCenter'], '0550'))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
v-alzhan-msft
Community Support
Community Support

Hi @Oskarkuus ,

 

1.png

The expression in the Filter array should as below:

@or(contains(item()?['Column1'], 'test1'),contains(item()?['Column2'], 'test2'),contains(item()?['column3'], 'test3'))

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you but i get this error

The template validation failed: 'The template action 'Filter_array' at line '1' and column '1252' is not valid: "Unable to parse template language expression 'or(startsWith(item()?['Personnummer'], triggerBody()['Filterarray_Value']),(startsWith(item()?['ReportYear'], triggerBody()['Filterarray_Value1']),(startsWith(item()?['RepportMonth'], triggerBody()['Filterarray_Value2']))': expected token 'Identifier' and actual 'LeftParenthesis'.".'.

 

on this code

 

@or(startsWith(item()?['Personnummer'], triggerBody()['Filterarray_Value']),(startsWith(item()?['ReportYear'], triggerBody()['Filterarray_Value1']),(startsWith(item()?['RepportMonth'], triggerBody()['Filterarray_Value2']))

 

i changed from Contains to startswith... is it that a problem?the pharasing "triggerbody()['filterarray_value']" is what i get from adding "Ask in Powerapps" to an filter array so i reused that over and over adding a number as flow does when using multiple.I tried to change to:

 

@or(startsWith(item()?['Personnummer'],['Filterarray_Value']),(startsWith(item()?['ReportYear'],['Filterarray_Value1']),(startsWith(item()?['RepportMonth'],['Filterarray_Value2']))

 

but did not work, same error.

Hi @Oskarkuus ,

 

Please take a try with expression below:

@or(startsWith(item()?['Personnummer'], triggerBody()['Filterarray_Value']),
startsWith(item()?['ReportYear'], triggerBody()['Filterarray_Value1']),
startsWith(item()?['RepportMonth'], triggerBody()['Filterarray_Value2']))

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Now it works to save the flow and i dont get anny errors.

but Powerapps does not pick up more than one

triggerBody()['Filterarray_Value']

1 and 2 does not show up so i cant send data to the Flow

 

Screenshot: https://prnt.sc/pzgyyo

Pstork1
Dual Super User III
Dual Super User III

1) Make sure you added more than one Ask in PowerApps content actions in the Flow.  You'll need a seperate one for each of the three parameters.

2) Did you remove and re-add your Flow under actions in the PowerApp?  This is usually required to refresh the flow definition when updates are made to the flow.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (54,325)