Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Country level filter from User profile

(2) ShareShare
ReportReport
Posted on by 92

Hi folks,

 

 

I want to filter the country dropdown in my PowerApps that fills in from the SharePoint master list.

 

Scenario 1: Verify whether a user is a member of a particular Azure ad group. If so, we would like to display all SharePoint list countries in the filter dropdown.


Scenario 2: We want to determine the current user's country from their user profile if they are not a member of a specific Azure AD Group. Then, we want to filter the SharePoint list based on that current user country, and retrieve the appropriate country from the SharePoint master list, and display it in the filter dropdown.

 

 

Could someone please help us implement such a scenario in PowerApps ?

 

Thanks In advance!

Categories:
  • tsa-svd2srv Profile Picture
    tsa-svd2srv 192 on at
    Country level filter from User profile
    I would avoid redundant API calls with a Global variable:
    Set(varIsGroupMember, "YourAzureADGroupID" in Office365Groups.CheckMemberGroups(User().Email, ["YourAzureADGroupID"]).value);
    Then in DropDown Items property:
    If(
        varIsGroupMember,
        'SharePointList'.CountryColumnName,
        Filter(
            'SharePointList',
            CountryColumnName = Office365Users.MyProfile().Country
        )
    )

    Replace "YourAzureADGroupID" with the actual group ID and CountryColumnName with the column name for countries in your SharePoint list.


    Then I would check these items:

    1.Integrate SharePoint Master List:

    •Ensure your SharePoint master list is added as a data source in PowerApps.

    2.Azure AD Group Check:

    •Add the Office365Groups connector to PowerApps.

    3.Retrieve User Profile Data:

    •Add the Office365Users connector to access the user’s profile.

    4.Test the Dropdown Logic:

    •Test both scenarios by switching users who belong to the Azure AD group and those who don’t.

    Let me know if it works.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard