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

How to filter Power Apps Gallery with a multi-select choice column

Dear Experts,

 

I need to filter Power Apps gallery with a multi-select choice column in SharePoint.

I am finding myself at wits end and need some help.

 

In the below example, i need to filter the gallery (List1) using a combo-box (Column1) with the  source as a multi-select choice column.

 

I would be grateful if you help me with the code.

Filter(List1, .........)

 

powerupguy_0-1668001375463.png

 

3 REPLIES 3
Drrickryp
Super User
Super User

@powerupguy 

 

Filter(
        yourlist,
                yourchoicecolumn.Value in ComboBox2.SelectedItems.Value
)

If you want the list to show all the items if the combobox is blank then

Filter(
       yourlist,
              Len(ComboBox2.Selected.Value) = 0 ||
              yourchoicecolumn.Value in ComboBox2.SelectedItems.Value
)

 

powerupguy
Frequent Visitor

yourchoicecolum.value gives an error message which says - "Invalid argument type. Cannot use table value in this context"

@powerupguy ,

You have a many-to-many filter here - the below is not Delegable (and you cannot make it so), but try this

If(
   Len(Combo2.Selected.Value) = 0,
   List1,
   Ungroup(
      ForAll(
         Combo2.SelectedItems As aSel,
         Filter(
            List1,
            aSel.Value in Column1.Value
         )
      ),
      "Value"
   )
)

 

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,195)