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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create/Upload Link to ...
Power Apps
Unanswered

Create/Upload Link to a SharePoint Document Library

(0) ShareShare
ReportReport
Posted on by 578

This question is probably a mix between PowerApps and Power Automate, but I was not sure where to ask it.  I create an app using PowerApps that allows me to upload/create files in a SharePoint document library.  I used a tutorial by Matthew Devaney, and everything works just fine. There are another bunch of tutorials that work as well. The issue now is that I've been asked to also being able to add Links the Document Library. I added the "Content Type, and I'm able to add links using the default way of adding files to a document library:

Links.png

The issue is I need to add that link using a custom PowerApps app that adds more metadata to the file/link. I create the file using a flow, and I pass a few parameters from PowerApps. When I upload add attachment I trigger among other things:

 

OnAddFile:

Set(
 theValue,
 First(colAttachments).Value
);
Set(
 theName,
 First(colAttachments).Name
);

 

 

Then I have a button that triggers the flow, and passes the parameters:

 

OnSelect:
Set(responseFromFlow, CreateFile.Run(
 {
 contentBytes: theValue,
 name: theName
 },
 title_2.Text,
 description_2.Text,
 category_2.Selected.Value,
 docType_2.Selected.Type,
 yearPub_2.Text,
 ro_2.Selected.RO,
 originalName,
 linkField.Text //This is the field where the user will enter the url
 
 ).status);

 

 

My question is. If I'm creating a Link instead of an actual file, what would the  contentBytes, and name be? I'm guessing the name could be created removing the "https://" portion of the URL and then:

 

linkField.Text &'.url'

 

I have no idea about the contentBytes. 

 

This is a screen shot of a portion of the Flow:

flow.png

 

Any lead would be appreciated. Thanks in advance.

 

Categories:
I have the same question (0)
  • Verified answer
    emfuentes27 Profile Picture
    578 on at

    I got it. When creating a link in a document library using the Create File from Power Automate. This site help me a lot. The File Should be the URL without the "HTTP://" portion, and add ".url" at the end. For the File Content, just use this format:

    [InternetShortcut]
    URL=https://google.com/

    Links2.png

     Links1.png

  • robbo1 Profile Picture
    12 on at

    Hi @emfuentes27 - would you mind sharing the updated parameters on the button for this solution? I'm having exactly the same problem, but I don't think I'm as good as you, so it would be helpful to see exactly how you achieved it! Thanks!

  • nandhan Profile Picture
    2 on at

    Hey , i need the exact same feature of uploading links to document libraries from powerApps , i really couldnt figure out how to do it. Can you help ?

  • emfuentes27 Profile Picture
    578 on at

    It's been a while, but I used the information of the attachments column:

    ClearCollect(
     colAttachments,
     myUpload.Attachments
    );
    Set(
     originalName,
     First(colAttachments).Name
    );
    
    Set(
     fileName,
     First(colAttachments).Value
    );
    Set(
     theValue,
     First(colAttachments).Value
    );
    Set(
     theName,
     First(colAttachments).Name
    );
    
    //Then run the flow:
    Set(responseFromFlow, CreateFile.Run(
     {
     contentBytes: theValue,
     name: theName
     },
     title.Text,
     description.Text,
     category.Selected.Value,
     docType.Selected.Type,
     yearPub.Text,
     ro.Selected.RO,
     originalName,
     linkField.Text
     
     ).status);

    Screenshot 2023-05-25 110116.png

  • PA-novice Profile Picture
    20 on at
    @emfuentes27: I'm trying to do the same thing, but I'm not sure exactly what you are doing. Is it possible to provide some more details? For example, are you using a file attachment but somehow not actually attaching a file but using the URL for the file? (The first graphic doesn't show in the post so that may have been where this was provided.)
     
    Sorry, I'm new and trying to learn. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard