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 / Filter multi selection...
Power Apps
Unanswered

Filter multi selection choices column with selectmultiple combobox

(0) ShareShare
ReportReport
Posted on by 11

Hi,

 

I try to create a tool to filter gallery with choices column.

 

Here is my dataverse table:

 

table.png

Here are my settings:
table name: 'Tasks Infos'
combobox name: subtasksFilter

subtasksFilter items: Choices('Tasks Infos'.Subtasks)

gallery items: 

Filter('Tasks Infos'; Concat(subtasksFilter.SelectedItems; Value & ",") in Concat(Subtasks; Value & ","))

 

I used this solution but it doesn't work perfectly. Items are hidden when filter is not enabled and doesn't work properly when combobox selection has wrong order. Here is what it looks like:

filter1.PNG

filter2.PNG

I would assume that by selecting 1, 3 gallery displays:

 

filter3.png

 

What is wrong with this formula? I tried before with Sharepoint list with choice that allow multiple selections but it works the same and also I read that sharepoint list has more limitation and dataverse is the database that I should use.

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    I think the problem is in your concat 

     

    Concat(subtasksFilter.SelectedItems; Value & ",")

    This will make "new1, new 2, new 3" 

    A filter does not work like that

    Filter(Source; task = Dropdown.Selecteditem)


    Not sure if thats why.. But I never saw a filter like yours... You dont have the "logic test"

  • Julass Profile Picture
    11 on at

    This formula gives an error: wrong comparison type.

    Filter('Tasks Infos'; Subtasks = subtasksFilter.SelectedItems)

     

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    After the selected items you need to put .Value

    And I am not sure if it will work for many items, as I said before

  • Verified answer
    Julass Profile Picture
    11 on at

    I found a solution in this video. It works but it is not ideal. It forces to use single line text as a source and not choices. Adding additional combobox makes the function looks like spaghetti. 

    I put here a code for others:
    App OnStart:

    ClearCollect(
     colItems,
     TestList2
    );
    ClearCollect(
     colOptions,
     RenameColumns(
     AddColumns(
     ["dog", "chicken", "pet", "boswell", "young"],
     "IsChoosen",
     true
     ),
     "Value",
     "OptionName"
     )
    );


    ComboBox1_2 Items:

    colOptions


    Reset icon OnSelect:

    ClearCollect(colYourItems, colItems);
    Reset(ComboBox1_2);


    Filter button OnSelect:

    // diselect all options
    UpdateIf(colOptions, true, {IsChoosen: false});
    
    // change IsChoosen to true for selected items from combobox
    ForAll(
     ComboBox1_2.SelectedItems As _item,
     If(_item in colOptions, Patch(colOptions, _item, {IsChoosen: true}))
    );
    
    // create empty collection that match exact
    Clear(colItemsToShowExact);
    
    // add items to exact collection based on IsChoosen
    ForAll(
     Filter(
     colOptions,
     IsChoosen
     ) As FilterChoices,
     Collect(
     colItemsToShowExact,
     Filter(
     colItems,
     FilterChoices.OptionName in ItemType
     )
     )
    );
    
    // remove duplicated items from exact collection
    ClearCollect(
     colYourItems,
     Filter(
     GroupBy(
     colItemsToShowExact,
     "ItemName",
     "ItemType",
     "Color",
     "DATA"
     ),
     CountRows(DATA) = CountRows(
     Filter(
     colOptions,
     IsChoosen
     )
     )
     )
    );


    Gallery Items:

    colYourItems

     

    Julass_5-1626417656642.png

     

     

  • MH-02091453-0 Profile Picture
    125 on at

    Please check out this discussion for a simple answer Re: Using a combobox to filter choices column - Power Platform Community (microsoft.com)

     

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard