Aug 24 2020 11:40 AM
Hello everyone,
As admin, I need to update the sharing capability of a SharePoint site using Power Automate.
I have not figured out a way of doing this with Graph API so I am now trying with SharePoint REST API.
Using, "Send an HTTP request to SharePoint", I can read the current setting on https://mytenant-admin.sharepoint.com/_api/Microsoft.Online.SharePoint.TenantAdministration.Tenant/S... but I can't use the Update method with POST.
Does anyone know how to do this?
Thanks !
Oct 19 2020 06:49 AM
@alextest how about PUT or, probably better use PATCH? Please try on non-production first.
Jun 15 2021 03:45 AM
In case someone looking for a solution, this is how I manage to solve this:
you need to use admin API, the URL of the admin API is
https://{tenant name}-admin.sharepoint.com/
you will need the site ID of the site that you want to change the sharing setting.
in your power automate add a new 'Send HTTP request to SharePoint'
Site address: https://{tenant name}-admin.sharepoint.com/
Method: Post
Uri: _api/Microsoft.Online.SharePoint.TenantAdministration.Tenant/Sites('{Site ID}')
Headers:
Body:
{
"__metadata": {
"type": "Microsoft.Online.SharePoint.TenantAdministration.SiteProperties"
},
"SharingCapability": 1
}
Oct 08 2021 12:45 PM
Mar 15 2023 02:17 PM
Hi,
https://{tenant}-admin.sharepoint.com/ not accepted as "Site Address" on "Send an HTTP request to Sharepoint"
Error: We are unable to find the site address. Please try selecting a site address from the dropdown.
Mar 15 2023 11:54 PM
@OmarSeri Replace {tenant} in URL with the actual name of your tenant where you are creating the flow. For example:
https://contoso-admin.sharepoint.com
And add it as a custom value like:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Jul 12 2023 12:05 AM
@ganeshsanap
I am facing the following error , any idea with,
connection account has sharepoint admin role, this flow is triggered from the power app, and the users running the power app doesn't have admin role. I think user doesn't require admin role as I have already have a connection to that action.
Jul 12 2023 01:35 AM
@hemanth1595 When you run the flow from Power Apps, flow automatically uses the credentials of user running the flow from Power Apps. Hence you are facing this issue.
To avoid this issue, you have to use the Run only users permissions on the flow.
Note: All actions using the SharePoint connector will run with the admin user account now.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.