cancel
Showing results for 
Search instead for 
Did you mean: 

Create sharing link for a file or folder in SharePoint for specific people

Hi,

 

Currently in the Microsoft Flow 'Create sharing link for a file or folder' the Link Scope field only has the following options:

- Anyone with the link, including anonymous

- People in your organization

 

Please also add the following option which is available in SharePoint and OneDrive:

- Specific people

 

We really need to be able to create a sharing link just for specific people.

Status: New
Comments
David_Nguyen
Microsoft

Hi @puszes31 

 

Share People with existing access means you need to know if the recipients already have the access. 

 

Then you just need to use the Get File Properties and pass the Full Path to create a link

 

image.png

 

If you want to share using the SharePoint format, here it is:

 

Uri: _api/web/Lists(guid'887C029D-25BE-467D-947C-FDF147AD1BA9')/GetItemById(@{triggerBody()?['entity']?['ID']})/ForwardObjectLink

*Guid is the listid.

Body:

 

{
"peoplePickerInput":"[{\"Key\":\"@{triggerBody()['text']}\"}]",
"emailBody":""
}

 

 

 

 

 

damiancastaneda
New Member

I'm agree. This would be too usefull.

toddcarr1
Regular Visitor

@damiancastaneda  If you look back one page you will see it is done and works.

bmoyer
Frequent Visitor

Hi @David_Nguyen 

 

I am also trying to send my own email with folder sharing link to an external email. You provided a workaround using the Sharepoint REST and ShareLink endpoint. Could you provide an example of the body of the request again please? I noticed there's an ObjectId - not sure what to provide for this. thanks

AIUYM19
Advocate V

Still a "new" idea 2.5 years later with 129 votes. 🙄 Why does Power Automate even bother offering to let users enter a "custom value" if it cannot accept custom values in this action? Way to go, Microsoft... wonderful customer experience yet again... 😑

 

 

 

 

Oh yeah; I forgot. You don't care about customer experience. Silly me.

m-emeraud
Regular Visitor

Needs the additional features of 

Specific people

block download

Block printing

lukasnaslund
Regular Visitor

Hi,

 

I am using trying to use Davids sample above but does not seem to get i right. I get the following error:

The query string "id" is missing or invalid.

Here is my URI:

lukasnaslund_0-1642610801778.png


Here is the body:
{
"request":{
"createLink":true,
"settings":{
"linkKind":7,
"expiration":null,
"role":2,
"restrictShareMembership":true,
"updatePassword":false,
"password":""
},
"peoplePickerInput":"[{\"Key\":\"email.email@hotmail.com\",\"DisplayText\":\"email.email@hotmail.com\",\"IsResolved\":true,\"Description\":\"email.email@hotmail.com\",\"EntityType\":\"\",\"EntityData\":{\"SPUserID\":\"email.email@hotmail.com\",\"Email\":\"email.email@hotmail.com\",\"IsBlocked\":\"False\",\"PrincipalType\":\"UNVALIDATED_EMAIL_ADDRESS\",\"AccountName\":\"email.email@hotmail.com\",\"SIPAddress\":\"email.email@hotmail.com\",\"IsBlockedOnODB\":\"False\"},\"MultipleMatches\":[],\"ProviderName\":\"\",\"ProviderDisplayName\":\"\"}]",
"emailData":{
"body":"",
"subject":""
}
}
}

Am I missing something in the URI or in body that might be causing this? The site is a modern team site. I have tried with headers in the requst as well. varLibraryID = ID from specific sharepoint documentlibrary that the item is located in. 

Best regards, 
Lukas

JC75NATS
Advocate II

@David_Nguyen  Hi I got this to work using LinkKind 6 and Role 7 to send a link with view and block download - Linkkind 7 chucks up a badgateway error.

Is there a way to do this so in the Enter Email box a user can specify multiple emails and a link generated for each users email entered 

 

 

sporter1584
Regular Visitor

@CraigMcK 

 

I ran into the exact same thought when using the action "Create a sharing link for a file or folder". It feels like it should match share button in SharePoint online to create a consistent experience.

sporter1584_1-1648666592549.png

 

However, I did find a work around using the action "Get File Properties". It allows you to get the link to the file with the existing sharepoint folder permissions applied. See dynamic content "Link to Item" 

 

sporter1584_2-1648666725870.png

sporter1584_3-1648666837441.png

 

 

Clo_Mo
Regular Visitor

@sporter1584 

I am very new to power automate. I like to create a link that uses "People with Existing Access" option. It seems like your suggestion does not achieve that. 

If my understanding is correct, is there a way to achieve creating a link that uses "People with Existing Access" option?

 

Thank you.