web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering a gallery ba...
Power Apps
Unanswered

Filtering a gallery based on a string with a multi-choice dropdown

(0) ShareShare
ReportReport
Posted on by 2

Hi guys

 

I'm not even sure if this is possible, but here goes. 

 

I have a dataverse table which has a text column, that text column contains a string with multiple values. 

For example "a, b, c, d". Then I populate a dropdown with the distinct values of that column. 

 

Now I want to filter my gallery based on the multiple selected items. 

So if I have 3 rows; 

 

1. a, d, c

2. a, c

3. a, b, c, d

 

If I select a I want it to return all the values, if I select a, d I want it to return row 1 and 2 and so on. 

 

Is there a way to do this? 

I have the same question (0)
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @JeroenH There is very likely a better solution and mine has one big downside but it might be sufficient for your needs:

     

     ForAll(
     GroupBy(
     Ungroup(
     ForAll(
     ComboBox1.SelectedItems,
     Search(
     SampleList,
     ThisRecord.Value,
     "request"
     )
     ),
     "Value"
     ),
     "ID",
     "myColumns"
     ),
     
     Last(
     FirstN(
     ThisRecord.myColumns,
     1
     )
     )
     )

     

    You have to replce some values based on your setup. So you need to change SampleList with your DataSource and ComboBox1 with the name of your ComboBox. Place this formular in the Items property of your gallery.

     

    Downside 1:

    - This will not work on large datasets

    - We will loose the ID column 😞 ..... I am working on a solution 🙂

     

    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.

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @JeroenH This will now have the ID back in the result:

     ForAll(
     GroupBy(
     Ungroup(
     ForAll(
     ComboBox1.SelectedItems,
     Search(
     SampleList,
     ThisRecord.Value,
     "request"
     )
     ),
     "Value"
     ),
     "ID",
     "myColumns"
     ),
     
     Patch(Last(
     FirstN(
     ThisRecord.myColumns,
     1
     )
     ),{ID:ThisRecord.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.

  • JeroenH Profile Picture
    2 on at

    My dataset consists of 20k + records so sadly this isn't an option. 

    I have converted the string to a "choices" type column now but it's still not letting me filter for some reason.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard