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 / How to hide gallery ba...
Power Apps
Unanswered

How to hide gallery based on filter options

(1) ShareShare
ReportReport
Posted on by 39
Hi Hello,
 
I have 2 filter Options. Filter A and Filter B.
Filter A: has SharePoint columns names,
Filter B: has SharePoint columns values selected in Filter A.
 
Below is the code written on filter A
Filter A - items = [" ","AD Account", "OU Path"]
Filter B - items
If(
        drpFilterClause.Selected.Value = "AD Account",
        Distinct(
            'OU-Access-Info',
            'AD-Account'
        ),
 
Currently the Gallery items are loading when i select filter value in Filter A. 
But my requirement is it should display gallery items when i select any value in Filter B.
How to achieve? Any help.
 
And below is the code on Gallery Items:
 
 
If(
        drpFilterClause.Selected.Value = "AD Account",
        Filter(
            'OU-Access-Info',
            Substitute(
                comFilterOptions.Selected.Value,
                "Access",
                ""
            ) in 'AD-Account'
        ),
        If(
            drpFilterClause.Selected.Value = "OU Path",
            Filter(
                'OU-Access-Info',
                Substitute(
                    comFilterOptions.Selected.Value,
                    "Access",
                    ""
                ) in 'OU Path'
            ),
)
Categories:
I have the same question (0)
  • Verified answer
    mmbr1606 Profile Picture
    14,567 Super User 2025 Season 2 on at
    hey
     
     
    can u try this in filter B:
    If(
        drpFilterClause.Selected.Value = "AD Account",
        Distinct('OU-Access-Info', 'AD-Account'),
        drpFilterClause.Selected.Value = "OU Path",
        Distinct('OU-Access-Info', 'OU Path')
    )
    
    and this in the items property of the gallery:
    If(
        !IsBlank(drpFilterClause.Selected.Value) && !IsBlank(comFilterOptions.Selected.Value),
        Switch(
            drpFilterClause.Selected.Value,
            "AD Account",
            Filter(
                'OU-Access-Info',
                Substitute(comFilterOptions.Selected.Value, "Access", "") in 'AD-Account'
            ),
            "OU Path",
            Filter(
                'OU-Access-Info',
                Substitute(comFilterOptions.Selected.Value, "Access", "") in 'OU Path'
            )
        ),
        'OU-Access-Info' // Default - shows all items if no filters are selected
    )
    
    if my answer helped please mark as verified,
     
     
    thanks
  • Suggested answer
    CU28081555-1 Profile Picture
    39 on at
     
    Thanks a lot, for the below help with this my requirement is achievd. 
  • CU28081555-1 Profile Picture
    39 on at
    Hi Markus, 
     
    Need one more help on this. 
     
    OU-Access-Info is my SharePoint List, displaying the items in gallery and implementing the pagination, and filter.
    Individually both functions are working, but how to combine them. Could you please help. 
    Below is the pagination code:
     
    /*LastN(
        FirstN(
            'OU-Access-Info',
            varPage
        ),
        RoundDown(
            GalleryAdmin.Height / GalleryAdmin.TemplateHeight,
            0
        )
    )*/
    If(
        drpFilterClause.Selected.Value = "Primary Owner",
        Filter(
            'OU-Access-Info',
            Substitute(
                comFilterOptions.Selected.Value,
                "Access",
                ""
            ) in 'Primary Owner'.DisplayName
        ),
        If(
            drpFilterClause.Selected.Value = "AD Account",
            Filter(
                'OU-Access-Info',
                Substitute(
                    comFilterOptions.Selected.Value,
                    "Access",
                    ""
                ) in 'AD-Account'
            ),
            If(
                drpFilterClause.Selected.Value = "OU Path",
                Filter(
                    'OU-Access-Info',
                    Substitute(
                        comFilterOptions.Selected.Value,
                        "Access",
                        ""
                    ) in 'OU Path'
                ),
                If(
                    drpFilterClause.Selected.Value = "Secondary Owner",
                    Filter(
                        'OU-Access-Info',
                        Substitute(
                            comFilterOptions.Selected.Value,
                            "Access",
                            ""
                        ) in 'Secondary Owner'.DisplayName
                    ),
                    If(
                        drpFilterClause.Selected.Value = "Reason for Access",
                        Filter(
                            'OU-Access-Info',
                            Substitute(
                                comFilterOptions.Selected.Value,
                                "Access",
                                ""
                            ) in 'Reason for Access'.Value
                        )
                    )
                )
            )
        )
    )

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard