Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SLNiXrTNTDYlFMyzEOhKks
Power Apps - Building Power Apps
Suggested answer

Power Apps connection with SharePoint

Like (2) ShareShare
ReportReport
Posted on 17 Apr 2025 11:03:58 by 4
I have a SharePoint list with staff and manager columns , but in some cases some staffs have more than one Manager , these managers have been put in a Microsoft 365 Group instead of listing the Managers individually 
Now in Power apps , I want the logged in User to only see records of Staffs they manage
 
How do I use Power Apps to check if the logged in user belongs to any of the groups listed in the Manager column in SharePoint 
  • ronaldwalcott Profile Picture
    3,653 on 17 Apr 2025 at 23:18:47
    Power Apps connection with SharePoint
    See Power Apps Get Office 365 Group Members on how to retrieve the group members.
  • Suggested answer
    Robu1 Profile Picture
    1,218 Super User 2025 Season 1 on 17 Apr 2025 at 12:26:58
    Power Apps connection with SharePoint
     
    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
  • stampcoin Profile Picture
    1,300 on 17 Apr 2025 at 12:23:42
    Power Apps connection with SharePoint
    You may want to try powerautomate :
    from app, you get the current user email  then pass to powerautomate,  then List the owned groups, and then list group members.
    collect the members and response back to app.
    if the current user own more than 1 group, you have to use loop, for example one manager could manager mutltiple teams.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard
Loading started