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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter Gallery by Mult...
Power Apps
Answered

Filter Gallery by Multiple Choice Column (Check boxes)

(0) ShareShare
ReportReport
Posted on by 1,121

I am filtering my gallery "GallMain" based on single select drop down column "Severity" (Values: Low, Medium,Priority) coming from SharePoint list "Power Platform Issues".  I have taken the dropdown values into a collection "CollSeverity" and displaying the collection as gallery "GallSeverity" with check boxes to filter the "GallMain". I have done this to filter GallMain not just with one value of priority but with multiple values. Whenever user selects the checkbox am dynamically creating another collection "CollSelectedSeverity" with selected check boxes. In order to filter the GallMain, I have placed below if condition in visible property of my gallery item.

If(ThisItem.Severity.Value in Concat(CollSelectedSeverity,Value), true,false)

This works well until I have 0 check boxes selected. When there are no check boxes selected, my gallery goes blank. GallMain Items property is pointing to my SharePoint list. How do I have this sorted out? I want my GallMain to show all items when no checkboxes are selected. @mdevaney @WarrenBelz @RezaDorrani 

 

EmptyGallery.PNG

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    It would seem to me that if none of the conditions are checked that the gallery should be blank. If all 3 are checked then all conditions would show. But if you want to treat that as a special case could you not just add and If statement for that condition?

    If(CollSeverity.Value="Low" And CollSeverity.Value="Medium" And CollSeverity.Value="High", ClearCollect(CollSelectedSeverity,GallMain),CollSelectedSeverity)

  • rameshmukka Profile Picture
    1,121 on at

    The gallery is empty because all my controls are set to below condition. I only want them to be visible when they severity value match with that of choice field(s) selected. Otherwise hide them. But when nothing is checked, I want all gallery items to show. I didnt understand how you formula can help me.

    If(ThisItem.Severity.Value in Concat(CollSelectedSeverity,Value), true,false)

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @RameshMukka ,

    Do you mean that:

    1)Severity a choice column that not allows multiple selection in sharepoint list;

    2)you want to filter based on Severity column;

    3)save the selections of Severity column to a collection named CollSeverity; the gallery to display this collection named GallSeverity;

    4)save the selections of GallSeverity to a collection named CollSelectedSeverity;

     

    Firstly, when filtering items of a gallery, you should set the gallery's Items based on filter rule, not to set each item's Visibility.

    Then I think you should set like this:
    the formula about creating CollSeverity:

    ClearCollect(CollSeverity,Choices('Power Platform Issues'.Severity))

    the items of GallSeverity:

    CollSeverity

    The checkbox's Text:

    ThisItem.Value

    Checkbox's OnCheck:

    Collect(CollSelectedSeverity,ThisItem)

    Checkbox's OnUncheck:

    Remove(CollSelectedSeverity,ThisItem)

    GallMain's Items:

    If(
     IsEmpty(CollSelectedSeverity), //no selected items
     'Power Platform Issues', 
     Filter('Power Platform Issues',Severity.Value in CollSelectedSeverity.Value)
     )

     

     

    Best regards,

  • rameshmukka Profile Picture
    1,121 on at

    Using in operator within filter is causing delegation issues. Please correct me if am wrong. So my intention is to solve delegation issue and I was hiding the  gallery items which doesn't match with my selected Severity Choices. Do you know how to handle delegation issue here while displaying gallery items when having selected several choices of Severity Column?

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @RameshMukka ,

    Firstly, its's not supported to set gallery's Items Visible.

    Could you tell me how many records are in your sharepoint list?
    If it is less then 2000 records, you just need to change delegation limit to 2000. Delegation warning will not affect the performance of your app.

    delegation.jpg

     

    If it is more than 2000 records, you indeed need to figure out the problem of delegation.

    Try this :

    the formula about creating CollSeverity:

    ClearCollect(CollSeverity,Choices('Power Platform Issues'.Severity))

    the items of GallSeverity:

    CollSeverity

    The checkbox's Text:

    ThisItem.Value

    Checkbox's OnCheck:

    If("HIGH"=ThisItem.Value,Set(varhigh,true),
    "MED"=ThisItem.Value,Set(varmed,true),
    "LOW"=ThisItem.Value,Set(varlow,true)
    );
    If(varhigh,ClearCollect(collection1,Filter('Power Platform Issues',Severity.Value="HIGH")));
    If(varmed,ClearCollect(collection2,Filter('Power Platform Issues',Severity.Value="MED")));
    If(varmed,ClearCollect(collection3,Filter('Power Platform Issues',Severity.Value="LOW")));
    ClearCollect(selecteditems,collection1,collection2,collection3)

    Checkbox's OnUncheck:

    If("HIGH"=ThisItem.Value,Set(varhigh,false),
    "MED"=ThisItem.Value,Set(varmed,false),
    "LOW"=ThisItem.Value,Set(varlow,false)
    );
    If(varhigh,ClearCollect(collection1,Filter('Power Platform Issues',Severity.Value="HIGH")));
    If(varmed,ClearCollect(collection2,Filter('Power Platform Issues',Severity.Value="MED")));
    If(varmed,ClearCollect(collection3,Filter('Power Platform Issues',Severity.Value="LOW")));
    ClearCollect(selecteditems,collection1,collection2,collection3)

    GallMain's Items:

    selecteditems
    

     

    The key point is to avoid using "in", which is not delegate for sharepoint list.

     

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard