Thank you for choosing Microsoft Power Platform Community.
In Power Apps, you can check if the logged-in user belongs to any of the Microsoft 365 Groups listed in the Manager column using the Microsoft Graph API along with Power Automate.
Here’s a step-by-step way to approach this:
To allow logged-in users to see only records of the staff they manage in Power Apps, follow these steps:
Retrieve User's Groups: Use the Microsoft Graph API or Office365Groups.ListUserGroups() to get the groups the logged-in user belongs to.
Compare Groups with the Manager Column: Use Power Apps functions like Filter() or LookUp() to check if any of the user’s groups match the SharePoint Manager column.
Use Power Automate if Needed: If complex filtering is required, create a Power Automate flow to retrieve the relevant records.
Power Apps Example Code
// Get groups the logged-in user belongs to
ClearCollect(UserGroups, Office365Groups.ListUserGroups().value);
// Filter staff records where Manager matches any user group
ClearCollect(FilteredRecords, Filter(StaffList, Manager in UserGroups));
This code collects the user’s groups and filters the list to display only staff members they manage.
Documentation References:
If this fixes the issue, please mark as resolved to help others with find it.
Happy to help
Robu1
SuperUser|Moderator