cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bee-Xpert
Frequent Visitor

Get an existing sharing link from an item or folder in SharePoint with PowerAutomate

Hello,

 

I've created a flow which allow me to automate this process :

1) Create a "customer folder" in my SharePoint library

2) Sharing it to an external user with the block "Grant access to an item or a folder"

 

Then I would like to

3) Get the new "Sharing Link" from my Flow (manually accessible on right-click & "manage access" from the item on my SharePoint)

5) Save user e-mail & this "Sharing Link" to an Excel database

4) Send a custom e-mail (not the automatic one built on the block) with the new "Sharing Link"

 

But How to GET this new "Sharing Link" on my Flow after it has been created from the block "Grant access to an item or a folder".

 

I tried something like @{outputs('Grant_access_to_an_item_or_a_folder')?['body/link/webUrl']} but it's not working.

Maybe the solution is an HTTP request ?

 

Thanks,

 

Dylan Bergozza

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarvinBangert
Super User
Super User

Hi @bee-Xpert 

there is a way to get this information using a SharePoint action "Send an HTTP request to SharePoint":

Site Address: <Select your Site>

Method: "POST" (GET is not supported)

Uri: "/_api/web/lists/getbytitle('<Your Library Name>')/items(<Your Item ID>)/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation"

Headers:

AcceptApplication/json
Content-TypeApplication/json

 

This will give you an overview about the different permissions giving from that SharePoint item. Within "permissionsInformation"/"Links"/"linkDetails"/"Url" you will find the Url you generated from the action before.

 

You will find the invited user in "Invitations", to send a custom email, deactivate the "Notify recipients" within the "Grant access to an item or a folder" and just send an email using the "Office 365 Outlook" connector.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

View solution in original post

3 REPLIES 3
MarvinBangert
Super User
Super User

Hi @bee-Xpert 

there is a way to get this information using a SharePoint action "Send an HTTP request to SharePoint":

Site Address: <Select your Site>

Method: "POST" (GET is not supported)

Uri: "/_api/web/lists/getbytitle('<Your Library Name>')/items(<Your Item ID>)/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation"

Headers:

AcceptApplication/json
Content-TypeApplication/json

 

This will give you an overview about the different permissions giving from that SharePoint item. Within "permissionsInformation"/"Links"/"linkDetails"/"Url" you will find the Url you generated from the action before.

 

You will find the invited user in "Invitations", to send a custom email, deactivate the "Notify recipients" within the "Grant access to an item or a folder" and just send an email using the "Office 365 Outlook" connector.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

bee-Xpert
Frequent Visitor

Hi @MarvinBangert,

 

Thanks a lot ! That works perfectly.

 

The hardest thing was to Parse my JSON correctly because I got this error :

"Invalid type.  Expected String but not Null"

 

Adding "null" type to the JSON shema resolved this issue.

 

Now everything is perfect 👍

 

Thanks again.

Thank you @MarvinBangert -- you are a lifesaver!

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,915)