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
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?
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
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
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:
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:
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.
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional