cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Oskarkuus
Level: Powered On

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

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

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.

Oskarkuus
Level: Powered On

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.

Community Support Team
Community Support Team

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.

Oskarkuus
Level: Powered On

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

Dual Super User
Dual Super User

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,750)