UPLOAD files from Power Apps to SharePoint Document Library Set Properties

UPLOAD files from Power Apps to SharePoint Document Library Set Properties Hello everyone Resa here in this video I will show you how to upload files to SharePoint and set the properties of those files in one go from power apps so let's check this video out in.

UPLOAD files from Power Apps to SharePoint Document Library Set Properties

[Music] action let's begin with creating a SharePoint document Library I'll pick one of the library templates invoices.

And use this template to create my document Library here I can upload files and I also have the ability to set the properties associated with this.

Document my library is ready let's see how we can build a power app that allows us to upload files and Associate metadata in make. power.

Apps.com I'll start with the page design and begin with a blank canvas app first I'll go ahead and connect to my SharePoint document Library I'll connect to.

SharePoint connect to my SharePoint site select my invoices document library and connect to show the data from my document Library I'll insert a gallery control connect this to my invoices.

Library now to upload documents from power apps we do not have a file upload control however we do have an attachments control that we can get if we leverage if form control.

Experience and connected to a SharePoint list so temporarily only to get that attachment control I will go ahead and add another connection to SharePoint and this time connect to a.

SharePoint list my form control data source will be that SharePoint list and one of the controls here is the attachments control that is a part of.

The attachments data card so what I can do here is I can copy this control head back to my screen and paste this.

Control the form control the only reason I added it was to get this attachment so I do not need it I will delete it also the association to my SharePoint list I no longer need it so I'll remove.

It now I have this attachment control I will rename this to attach for the user to upload files I'll add another screen in my.

Posts Related:

    App and this attachment control I will

    Cut it from my home screen and paste it in this second screen now this control has a few errors to begin with one of the properties is.

    Border color I'll go and remove that for formula tool tip remove the formula do the same for every property that is erroring out this control allows the user to.

    Upload multiple files you can Define how many number of files can they attach and what can be that maximum attachment size if I preview and click attach file I can start attaching files to this.

    Control you can also attach multiple files remove this also supports drag and drop I'll insert a button I'll set the text of this button to.

    Upload and on select of this I would like to go ahead and upload this file to my documents library to do that I will take the help of power aut it I'll click on create new.

    Flow click create a flow it leverages the new power apps V2 trigger I'll add an input I will select the type as file so this will allow power apps to.

    Call Flow and pass information about a file that I would like to upload to my document library in SharePoint and to do that we have a create file action in.

    SharePoint I'll put my SharePoint site address where this document Library exists for the folder path I'll go to show picker and directly select my document Library called.

    Invoices file name and file content for file content we have Dynamic content available from the Trigger action which is file content so I'll select.

    This if you hover over this it will show

    The expression behind it which is trigger body file and from within it it reads the content bytes for file name all we have to do is.

    Copy thisr a contrl c go to file name go to EXP expression paste it the expression begins with at and a curly brace remove it the expression ends with the curly brace remove.

    It this leaves us with trigger body file instead of content bytes I will use name all lowercase I'll click okay I would want power apps to wait for flow to go ahead and create the.

    File I will add another step here respond to a power app action from the power apps connector here I'll add an output of type.

    Text I'll say file uploaded yes that completes my flow very important to name the flow upload file to SharePoint and click.

    Save this will go ahead and save the flow in power automate plus connect to that flow from my power app now for my upload buttons on Select.

    Property all I have to do here is go ahead and Trigger my flow run as I start typing the name of my flow which was upload file you can see how intelligence guides me through to call the flow you.

    Have to call the run method of the flow so I'll use upload file to SharePoint do run I need to pass an input parameter which is an object file and this is expecting a record a record that.

    Includes two pieces of information name and content bytes a record is represented by curly braces within this name all lowercase this will be the name of the.

    File I can use attach dot attachments that gives me all the attachments from this attachments control for now we are focused on uploading one.

    File so I'll use the property first to get the first file that's attached dot name comma my second property is content.

    Bytes first attach do attachments dot value that completes my file property I'll close it with a curly brace and close my function with a round bracket now let's connect the two.

    Screens together screen one here I'll insert a button we call it upload files on select of this button I will navigate the user to my second.

    Screen upload takes me to my second screen now whenever I land on the screen I would want to reset the data in the attachments control the screen has an unvisible.

    Property here I will use the formula reset the name of my attachment control let's go back to screen one upload files the attachments control starts from a clean.

    Slate upload this button should be active only if a file is attached the display mode property of this button if count.

    Rows of attach do attachments is greater than zero you set the display mode to edit else you set the display mode to disable so the moment the user uploads a file.

    This button becomes active when upload is clicked we have our formula to call the flow right after this go ahead and take the user back to.

    My previous screen which is my home screen let's go back to the home screen and try the entire scenario out upload files I can attach a document click upload this should go ahead and Trigger.

    My flow the flow should go ahead upload my document I can confirm that by exploring my document Library the file has been.

    Uploaded the gallery may show the new record or may not one of the things we can do is insert one of the icon controls called reload please note we want to do a.

    Reload not a refresh I want the G gallery to reinitiate the query to get the documents and to do that when this icon is clicked I will set a variable called.

    Where reset to false and then I will set that same variable V reset to true all I'm doing here is changing state of a.

    Variable this variable I will use to filter the items of my gallery filter invoices on that variable so.

    Now let's go try upload another file the flow gets called this time if I select this it got me the document that was uploaded to allow the user to edit the.

    Properties of existing documents next Arrow icon in the gallery when the user user selects this what I can do is take the user to a screen that has a form.

    Control and we have templates for that type of screen so I'll simply select the form screen here we have the form control I'll connect this to my invoices.

    Document Library this will start bringing in the columns when the user clicks on the accept icon it will submit the data in this form control the form control has a.

    Property called item the context of that comes from the gallery on my home screen so here I can simply use the name of my gallery do selected and the form control has an on.

    DISCLAIMER: In this description contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission. This helps support the channel and allows us to continuetomake videos like this. All Content Responsibility lies with the Channel Producer. For Download, see The Author's channel. The content of this Post was transcribed from the Channel: https://www.youtube.com/watch?v=QUwzvUXgj58
Postagem Anterior Próxima Postagem