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

Multiple filter function on a SP List

Hello Community,

 

I am a beginner on Powerapps. I am currently stucking on the filter function. I am trying to apply two filters on a same list :

The list is a computer's inventory that I want to display the available computers and the loaned computers, but I want to have the choice to display :
- only HP (or any other manufacturer) computers available

- only HP (or any other manufacturer) computers loaned
- onlt the HP & Microsoft (or any other manufacturers) computers available

- onlt the HP & Microsoft (or any other manufacturers) computers loaned
- only the available computers
- only the loaned computers

...

Is anyone could help me please?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Multiple filter function on a SP List

Hi @SalemB ,

Could you please share a bit more about the Available column in your SP list? Is it a Number type column?

Do you want to filter your Data Table records based on the selected values within your two List Box controls?

I assume that the Available column is Number type column in your SP list, and Available column = 1, means that the corresponding PC is available, Available column = 0, means that the corresponding PC has been loaded. And the Manufacturer column is a Single line of text type column in your SP list.

 

I have made a test on my side, please take a try with the following workaround:6.JPG

Set the Items property of the ListBox1 to following:

 

["Microsoft", "HP", "Lenovo", "Dell"]

Set the Items property of the ListBox2 to following:

["Available", "Loaded"]

Set the Items property of the Data Table control to following:

Filter(
'20181019_case9_Courses',
If(
!IsEmpty(ListBox1.SelectedItems),
Manufacturer in ListBox1.SelectedItems.Value,
true
)
)

On your side, you should type the following formula:

Filter(
'YourSPList',
If(
!IsEmpty(ListBox1.SelectedItems),
Manufacturer in ListBox1.SelectedItems.Value,
true
),
If(
!IsEmpty(ListBox2.SelectedItems),
Available in AddColumns(RenameColumns(ListBox2.SelectedItems,"Value","TextValue"),"NumberValue",If(TextValue = "Available", 1, 0)).NumberValue,
true
)
)

 

Above formula may cause a Delegation warning issue, if you want to get rid of this warning issue, please check the following workaround:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(RecordsCollection, 'YourSPList')

Set the Items property of the Data Table control to following:

Filter(
RecordsCollection,
If(
!IsEmpty(ListBox1.SelectedItems),
Manufacturer in ListBox1.SelectedItems.Value,
true
),
If(
!IsEmpty(ListBox2.SelectedItems),
Available in AddColumns(RenameColumns(ListBox2.SelectedItems,"Value","TextValue"),"NumberValue",If(TextValue = "Available", 1, 0)).NumberValue,
true
)
)

 

Best regards,

 

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

View solution in original post

3 REPLIES 3
TimRohr
Level 10

Re: Multiple filter function on a SP List

Hi, @SalemB 

@RandyHayes  and I just put similar instructions to what you would need on this thread. See if that helps you get started. If we need to back up and start more basic, we can.

Community Support Team
Community Support Team

Re: Multiple filter function on a SP List

Hi @SalemB ,

Could you please share a bit more about the Available column in your SP list? Is it a Number type column?

Do you want to filter your Data Table records based on the selected values within your two List Box controls?

I assume that the Available column is Number type column in your SP list, and Available column = 1, means that the corresponding PC is available, Available column = 0, means that the corresponding PC has been loaded. And the Manufacturer column is a Single line of text type column in your SP list.

 

I have made a test on my side, please take a try with the following workaround:6.JPG

Set the Items property of the ListBox1 to following:

 

["Microsoft", "HP", "Lenovo", "Dell"]

Set the Items property of the ListBox2 to following:

["Available", "Loaded"]

Set the Items property of the Data Table control to following:

Filter(
'20181019_case9_Courses',
If(
!IsEmpty(ListBox1.SelectedItems),
Manufacturer in ListBox1.SelectedItems.Value,
true
)
)

On your side, you should type the following formula:

Filter(
'YourSPList',
If(
!IsEmpty(ListBox1.SelectedItems),
Manufacturer in ListBox1.SelectedItems.Value,
true
),
If(
!IsEmpty(ListBox2.SelectedItems),
Available in AddColumns(RenameColumns(ListBox2.SelectedItems,"Value","TextValue"),"NumberValue",If(TextValue = "Available", 1, 0)).NumberValue,
true
)
)

 

Above formula may cause a Delegation warning issue, if you want to get rid of this warning issue, please check the following workaround:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(RecordsCollection, 'YourSPList')

Set the Items property of the Data Table control to following:

Filter(
RecordsCollection,
If(
!IsEmpty(ListBox1.SelectedItems),
Manufacturer in ListBox1.SelectedItems.Value,
true
),
If(
!IsEmpty(ListBox2.SelectedItems),
Available in AddColumns(RenameColumns(ListBox2.SelectedItems,"Value","TextValue"),"NumberValue",If(TextValue = "Available", 1, 0)).NumberValue,
true
)
)

 

Best regards,

 

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

View solution in original post

SalemB
Level: Powered On

Re: Multiple filter function on a SP List

Thank you both for the help you provided 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 371 members 6,694 guests
Please welcome our newest community members: