cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Partisan
Post Partisan

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
Highlighted
Dual Super User II
Dual Super User II

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

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.
Highlighted
Community Support
Community Support

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

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.

Highlighted
Post Partisan
Post Partisan

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

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.

Highlighted
Community Support
Community Support

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

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.

Highlighted
Post Partisan
Post Partisan

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

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

Highlighted
Dual Super User II
Dual Super User II

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

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,419)