cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gilmour
Helper IV
Helper IV

Creating SharePoint file sharing link using PowerApps and Power Automate

I am trying to get a file sharing link via PowerApps + Power Automate. The flow I've built (see below) fails, giving me a "Scope is not valid" error for the Create Sharing Link action. Up to that point, everything else works. What am I doing wrong?

 

Quick flow explanation:

 

- Choose a file from library using PowerApps 

- Choose recipients of sharing link via PowerApps

- Get Files (properties only) for all files in library

- Filter output Get Files (properties only) where File name with Extension is the same as selected in PowerApps

- Create sharing link for the selected file

 

Thank you!

 

Gilmour_0-1660513446148.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

What formula are you using for the Item ID?  The filter array will return a collection even if there is only one item, so you need to use first() to get the first record.

 

Also, there is no action for creating a sharing link for specific people.  The scope is either people in my organization or anyone with the link. I'm not aware of any action or REST call that lets you create a link for specific people like the user interface in SharePoint does.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Pstork1
Dual Super User
Dual Super User

The problem is that action only allows creation of an anonymous link or one that is limited to Internal users only.  So there is no way to use that action to share the file with external users without using the Anyone with the link scope.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

What formula are you using for the Item ID?  The filter array will return a collection even if there is only one item, so you need to use first() to get the first record.

 

Also, there is no action for creating a sharing link for specific people.  The scope is either people in my organization or anyone with the link. I'm not aware of any action or REST call that lets you create a link for specific people like the user interface in SharePoint does.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Gilmour
Helper IV
Helper IV

Hi @Pstork1 , you hit the nail on the head: in further auditing the flow, I realized that the creation of the link was not the issue, but scope of the link, as you rightly suspected.

 

I suppose I'll have to figure out a way to include external users (with the appropriate levels of access and security for my information) in some group, then share the link with them. I'd like to avoid the "Anyone with the link" option. Any further thoughts are much appreciated.

 

Thank you!

Pstork1
Dual Super User
Dual Super User

The problem is that action only allows creation of an anonymous link or one that is limited to Internal users only.  So there is no way to use that action to share the file with external users without using the Anyone with the link scope.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (5,270)