Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Create sharing link for a file or folder

Like (0) ShareShare
ReportReport
Posted on 18 Sep 2020 18:30:47 by 336

I have a flow that is working successfully. 

I would like to edit the flow such that I create a sharing link for the newly created file (trigger for the flow to initiate), however, I don't understand why there is no dynamic content available, so am not sure what to manually input?  Also, when prompted for 'Library Name' the only option was 'Documents', so instead I inserted a link to the actual folder within the Document library.

Not sure what I'm doing wrong.

 

PeggyLang_0-1600453609345.png

 

  • Gilmour Profile Picture
    362 on 14 Aug 2022 at 16:14:24
    Re: Create sharing link for a file or folder

    Is there a way to create a sharing link for an existing file in a library via powerautomate (perhaps in combination with powerapps)? Basically what I am trying to do is to select a file already existing in SP via a field in powerapps, then retrieve a sharing link using a flow. Thanks!

  • Community Power Platform Member Profile Picture
    on 14 Jan 2022 at 00:55:21
    Re: Create sharing link for a file or folder

    hi @PeggyLang ,

     

    Im a newbies try to play with this power automate, mind if you share full flow for my reference?.

     

    thanks.

  • Verified answer
    CFernandes Profile Picture
    8,283 Most Valuable Professional on 21 Sep 2020 at 18:36:54
    Re: Create sharing link for a file or folder

    @PeggyLang 

     

    Wohoo. I am glad that your problem has been resolved. I assume your original question is answered. So it will be great if you can mark it as Solution. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search.

     

    To create nicely formatted, link. Just have a look at the Solution I provided at https://powerusers.microsoft.com/t5/Building-Flows/Item-URL-in-email/m-p/694882#M94098 

     

     

  • PeggyLang Profile Picture
    336 on 21 Sep 2020 at 18:27:32
    Re: Create sharing link for a file or folder

    Oh My GOSH - what an awful error on my part.  I apologize!  It WORKS!

    another question - the sharing link is not a hyperlink that can be clicked on - what have I done wrong now?

     

    PeggyLang_0-1600712830302.png

     

  • CFernandes Profile Picture
    8,283 Most Valuable Professional on 21 Sep 2020 at 17:53:21
    Re: Create sharing link for a file or folder

    @PeggyLang You need to use use the 'Get File Properties' action. NOT 'Get Files (Properties only)'

     

     
     

    Power If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • PeggyLang Profile Picture
    336 on 21 Sep 2020 at 17:47:27
    Re: Create sharing link for a file or folder

    @CFernandes , thank you.  That step sounded reasonable, however, when I add it the condition automatically changes to 'apply to each'.  I don't know why?

    PeggyLang_1-1600710380597.png

     

  • Verified answer
    CFernandes Profile Picture
    8,283 Most Valuable Professional on 21 Sep 2020 at 16:55:10
    Re: Create sharing link for a file or folder

    @PeggyLang 

     

    >> I don't want to look at all the other files, only want to look at the newly created file. 

     

    You can use the 'Get File Properties' action.

     

    Untitled.png

     

    It will return you 'File Name with Extension'

     

     

    Untitled1.png

     

     

    Power If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • PeggyLang Profile Picture
    336 on 21 Sep 2020 at 16:42:19
    Re: Create sharing link for a file or folder

    The below snapshot of my flow works WITHOUT the 2 actions in the red box.  

    Basically, the flow looks at a newly created file and performs an action (post to Teams channel) based on parameters of the file name; i.e., 'x-ms-file-id'.  

        If 'x-ms-file-id' contains 'Fee' AND contains pdf then x

        If 'x-ms-file-id' contains 'Billing' AND contains xls then y

        etc. . .

    Worked beautifully . . . then I got greedy and wanted to include a sharing link to the file in the post to Teams channel. 

    When I added the 2 actions in red box (Create sharing link & Compose) the condition automatically changes to 'apply to each'. 

    I don't want to look at all the other files, only want to look at the newly created file. 

    As well as the dynamic content options seem to change ('x-ms-file-id' is no longer an option) and I have yet to find a dynamic content that will allow me to look at the file name to make my comparisons.  
    There must be a way around this, perhaps extrapulating the filename (with extension) of the newly created file right after the trigger and then using that string/variable (not sure of the correct syntax) in my conditions?

     

     

    PeggyLang_1-1600705652228.png

     

  • CFernandes Profile Picture
    8,283 Most Valuable Professional on 18 Sep 2020 at 18:45:01
    Re: Create sharing link for a file or folder

    @PeggyLang You might can use a different trigger which will return you more dynamic content 'When a File is create(properties only)'

     

    CFernandes_0-1600454659206.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • ScottShearer Profile Picture
    25,218 Most Valuable Professional on 18 Sep 2020 at 18:43:30
    Re: Create sharing link for a file or folder

    @PeggyLang 

    I can't say why the ID isn't returned with this action.  However, if you use the When a file is created (properties only) trigger instead you can specify the folder and it does return the ID.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started