web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / create clickable link ...
Power Automate
Answered

create clickable link in a sharepoint document library

(1) ShareShare
ReportReport
Posted on by 18

Hello,

 

I need to create in one sharepoint library a clickable link (shortcut) of a document that is just created in other library (link autocreation for new documents in the "other library")

 

I'm trying to do it in this way:

 

Capture.PNG

 

But getting below error message (under "OUTPUTS" section):

 

{
"status": 400,
"message": "To add an item to a document library, use SPFileCollection.Add()\r\nclientRequestId: 7a2f0e11-34c9-458e-bcbe-d829fd897cd1\r\nserviceRequestId: 7045b49e-209b-7000-6874-8dbe10f7d220"
}
 
I assume I cannot use "Create Item" action for sharepoint library, so how can I build this functionality?
Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @przlwo:

     

    If I understand you correctly, you want to create a link to a document.  If so, you don't want to use a library.  Rather you want to use a list and Create Item.  Include a hyperlink coumn in the list.

     

    MakeLink.jpg

    If this addresses your issue, please mark you post as Solved.

     

    Scott

     

     

  • przlwo Profile Picture
    18 on at

    Hi Scott,

     

    This is not exactly what I want to achieve. When I apply your suggestion, in the URL column (Hyperlink or Picture) I can see link to the document - which is ok - but when I click on this link, I can only open the file in client version or MS Word.

    I'd like to achieve same efect what you can see when you add new document to a sharepoint library with use of "Link to a Document" content type. There are two properties - Document Name and Document URL, after I add link in this way, I can see in "Title" column the document name and when click on the name, the document is opening in browser.

     

    I hope you understand and are able to reproduce what I explained.

     

    Thanks

     

     

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @przlwo:

     

    If you append ?web=1 to the URL of an Office document in SharePoint, it will open in the web app.  That said, it isn't working the way I expected.....

     

    I will test and respond later tonight with how to open in the web app as well as adding the link description.

     

    Scott

  • przlwo Profile Picture
    18 on at

    This works for opening document in browser, however I still need one more thing: how to put the updated URL under a document title (just to be able to click on the document name/title and then the document is opening in browser)?

    Something like on below screen where in a document library I created a link (by "Link to a Document" content type) and no when I click on "Test", the document is opening in browser.

     

    Is it possible to achieve this by workflow created in MS Flow?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Unfortunately it is impossible to create. You have to upload a link to a document ASPX file (download the file when you create one manually) and then assign the property.

    BUT this will not result in a valid link to a document... I tried... Even the Add-PNPFile commandlet does not work correctly to create a valid link to a document item within a document library

  • Verified answer
    przlwo Profile Picture
    18 on at

    Hi, good news for everyone that needs this functionality. I found the way how to do it.

    1. Create a link to a document in a library (that has "Link to document" content type assigned)

    2. Check if the newly created link works as expected.

    3. Download the link file (aspx)

    4. Create workflow as below (paste the aspx file content to "File content" field. All that needs to be changed in the content file is the document url (two times) - as shown on the below screen.

     

    And that's it 🙂

     

    Capture.PNG

  • RogierDuurkoop Profile Picture
    21 on at

    Simple solution:

    Step 1 : Create sharing link for a file or folder.

    Step 2: Uploads a file to a SharePoint site. Make sure to pick an existing library.

    Step 3: See screenshot. Add:

    [InternetShortcut]
    URL=

     

    Flow.jpg

  • FMW Profile Picture
    34 on at

    Dear Przlwo,

    is there a chance you cuold up load the text inserted into the File Content field? Unfortunately I cannot read it nor copy paste it...

  • FMW Profile Picture
    34 on at

    Dear RogierDuurkoop

     

    where to enter the origin folder of the file and where the target folder for the link?

  • FMW Profile Picture
    34 on at

    @RogierDuurkoopand whats the trigger you are using?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 389

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard