Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Gallery items pagination integration with filter

Posted on by 39
Hi Hello,
 
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. 
 
/*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
                    )
                )
            )
        )
    )
)

 
  • Suggested answer
    jpespena Profile Picture
    jpespena 264 on at
    Gallery items pagination integration with filter
    Hi,
     
    Try using Switch() instead of If():
     
    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'
    ),
    "Secondary Owner",
    Filter(
    'OU-Access-Info',
    Substitute(
    comFilterOptions.Selected.Value,
    "Access",
    ""
    ) in 'Secondary Owner'.DisplayName
    ),
    "Reason for Access",
    Filter(
    'OU-Access-Info',
    Substitute(
    comFilterOptions.Selected.Value,
    "Access",
    ""
    ) in 'Reason for Access'.Value
    ),
    'OU-Access-Info'
    )
    The last 'OU-Access-Info' is the default if no selected value for drpFilterClause

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard