cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emfuentes27
Resolver II
Resolver II

Create/Upload Link to a SharePoint Document Library

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
emfuentes27
Resolver II
Resolver II

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

View solution in original post

1 REPLY 1
emfuentes27
Resolver II
Resolver II

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (5,115)