Skip to main content

Notifications

Community site session details

Community site session details

Session Id : M1P9SMW2YAqBgyneu1tfvM
Power Automate - Building Flows
Answered

Finding the owner of a SharePoint site

Like (0) ShareShare
ReportReport
Posted on 8 Oct 2020 07:55:01 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?

  • Community Power Platform Member Profile Picture
    on 06 Mar 2023 at 17:58:40
    Re: Finding the owner of a SharePoint site

    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

  • AndyTuke1 Profile Picture
    75 on 12 Oct 2020 at 14:18:52
    Re: Finding the owner of a SharePoint site

    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

  • Verified answer
    v-litu-msft Profile Picture
    on 09 Oct 2020 at 02:19:33
    Re: Finding the owner of a SharePoint site

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started
Loading complete