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!
Set(varIsGroupMember, "YourAzureADGroupID" in Office365Groups.CheckMemberGroups(User().Email, ["YourAzureADGroupID"]).value);
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.
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.