cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tpj1215
Frequent Visitor

Multiple selection combobox filter SharePoint List

I would like to filter based on multiple selected values from Risk_Filter and/or any filter from Status_Filter and/or ID search. 

Currently the code works, but Risk_Filter behaves like a single selection filter. It can . Please let me know how to filter by multiple selected values on Risk_Filter. 

Ex) Risk_Filter selects 'L', 'H', 'M', but the Gallery2 shows only the results containing 'M' value. 

tpj1215_2-1635883609856.png       tpj1215_4-1635884063132.png

 

Currently using SharePoint List. The total number of rows is about 200. 

Combobox/ Search/ Gallery  Name

Field Name

Field Type

Selection/search type

Distinct Values

Items function

Risk_Filter

CurrentRisk

single line of text

Multiple selection

tpj1215_0-1635884978988.png

 

8 (including blank)

Sort(Distinct(SP_DataSourceName, CurrentRisk), Result)

Status_Filter

ShipStatus

single line of text

Single selection

5 (including blank)

Sort(Distinct(SP_DataSourceName, ShipStatus), Result)

ID_Search

field_ID

single line of text

No, search

About 200

-

Gallery2

-

-

-

-

Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.Selected.Result) || CurrentRisk = Risk_Filter.Selected.Result)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)
), ID_Search.Text, "field_ID")

 

 

 

@RezaDorrani @zmansuri @Mr-Dang-MSFT @RandyHayes 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
PTBBSolutions
Solution Supplier
Solution Supplier

Please change the = Risk_Filter..... to ' in Risk_Filter...'

View solution in original post

tpj1215
Frequent Visitor

I found it! Thanks for your support! It was close. It works now!!!

 

Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.SelectedItems) || CurrentRisk in Risk_Filter.SelectedItems)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)
),ID_Search.Text, "field_ID")

View solution in original post

9 REPLIES 9
WarrenBelz
Super User
Super User

Hi @tpj1215 ,

Try the below

Search(
   Filter(
      SP_DataSourceName,
      (
         IsBlank(Risk_Filter.Selected.Result) || 
         CurrentRisk in Risk_Filter.SelectedItems
      )&&
      (
         IsBlank(Status_Filter.Selected.Result) || 
         ShipStatus = Status_Filter.Selected.Result
      )
   ),
   ID_Search.Text, 
   "field_ID"   
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

PTBBSolutions
Solution Supplier
Solution Supplier

If you want ot take advantage of the multiple items, in the search  clause you should change the condition from Risk_Filter.Selected.Results to Risk_Filter.selectedItems.Value.

 

If this helps, please accept it as a solution.

I forgot to exclude '&&' after 'Status_Filter.Selected.Result))'. Your answer is exactly the same as my current code. No change has been made.

I changed the code from 

 

Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.Selected.Result) || CurrentRisk = Risk_Filter.Selected.Result)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)&&
), ID_Search.Text, "field_ID")

 

and tried 

Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.SelectedItems.Value) || CurrentRisk = Risk_Filter.SelectedItems.Value)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)
),ID_Search.Text, "field_ID")

 

and this one
Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.SelectedItems.Result) || CurrentRisk = Risk_Filter.SelectedItems.Result)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)
),ID_Search.Text, "field_ID")

 

but the Gallery2 shows an empty screen with a Search delegation warning. 

tpj1215_0-1635888206445.png

tpj1215_1-1635888221175.png

 

 

PTBBSolutions
Solution Supplier
Solution Supplier

Please change the = Risk_Filter..... to ' in Risk_Filter...'

View solution in original post

@PTBBSolutions , I tried this below solution, but it gives wrong filtered results.

Ex) When 'L', 'M' are filtered, the result brings 'H'...

 

 

Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.SelectedItems.Result) || CurrentRisk in Risk_Filter.SelectedItems.Result)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)
),ID_Search.Text, "field_ID")

WarrenBelz
Super User
Super User

@tpj1215 ,

Pretty much what I posted - tag me if you want further assistance, but I think you will find my post is close to what you need.

tpj1215
Frequent Visitor

I found it! Thanks for your support! It was close. It works now!!!

 

Search(Filter(SP_DataSourceName,
(IsBlank(Risk_Filter.SelectedItems) || CurrentRisk in Risk_Filter.SelectedItems)&&
(IsBlank(Status_Filter.Selected.Result) || ShipStatus = Status_Filter.Selected.Result)
),ID_Search.Text, "field_ID")

View solution in original post

@tpj1215 ,

Apart from the suggestion to use Len() instead of IsBlank (as I have found it more reliable at detecting empty controls), that is exactly what I posted . . .

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,425)