web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Finding the owner of a...
Power Automate
Answered

Finding the owner of a SharePoint site

(0) ShareShare
ReportReport
Posted on by 75

Hi everyone,

I've got a Flow that I'm developing for a customer to allow them to use an approval process for News posts on their new SharePoint intranet.  The Flow works fine, filtering to check if a new page is a News Post or a standard page and starting an approval process for News only. 

The approvers are hard coded in and I would like to have it set to query the site for its owners and use the resultant list for the approvers.  Amazingly, the Graph API doesn't doesnt support this.  I have seen posts on the internet where people suggest using the drive property of the site which does expose the owner but in testing it doesnt seem to return a result for every site I've tried it on.

The SharePoint REST API does expose the owner property as documented here

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj246231(v%3doffice.15)

So I've built this test Flow

Site Owner Flow.png

 

Which works, but only returns a single user when I know my site has 2 owners.  Has someone got a better way to find a list of site owners in SharePoint?

Categories:
I have the same question (1)
  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @AndyTuke1,

     

    Try using below endpoint to get the Site Members from Members group:

    _api/Web/SiteGroups/GetByName('SiteName Members')/users
    

    To get the specific property for user, you can add $select query as given below:

    _api/Web/SiteGroups/GetByName('SiteName Members')/users?$select=Email,Id
    

    You can get the following user properties using this endpoint:

    1. Email
    2. Groups
    3. Id
    4. IsHiddenInUI
    5. IsSiteAdmin
    6. LoginName
    7. PrincipalType
    8. Title
    9. UserId

    You can find everything related to Users, groups, and roles using REST API in the below article(Must visit, this is a very helpful article): Users, groups, and roles using REST API.

     

    For example, my site name is "Ice Cream", the uri should be:

    Screenshot 2020-10-09 101658.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • AndyTuke1 Profile Picture
    75 on at

    Thats great, works perfectly.

     

    One thing, the documentation is lacking a bit and some of the pages for the REST API are marked s "This page is no longer being updated".  Is this because all the functionality is being moved to the GRAPH API, which requires a premium Power Automate licence? 

    You used the GetByName but I can't find any document for the API listing what else can be used, the only reference to GetByName is in an example

  • Community Power Platform Member Profile Picture
    on at

    Hello all

     

    @v-litu-msft / @AndyTuke1 I was looking at this post and this is similar to a request I have. Is it possible to iterate  through all sites in a collection and get a list of the owner(s) for each site within the site collection?

     

    Cheers!

    DWTKBrook

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard