⬆️Upload to a SharePoint Library with Metadata

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome back today we're going to take a look on how we can upload files from a powerapp into a sharepoint document library but sometimes you want to do a little bit more than that sometimes you want to get rid of your folder system that you're currently using probably and start using a metadata system where you populate metadata for each file and then you can filter based on that let's take a look on how we can do that from powerapps and with help of a simple but useful power automate flow stick around give a thumbs up if you like the video and make sure to subscribe so let's begin with creating a document library first of all because we need a place where we are going to upload our documents for that i will go to site contents in my test sharepoint site and i will create document library name it demo app and yeah let's show the navigation why not select create and now we have here by default the name and modified and modified by i will go on and remove these columns or hide them since i don't want them now to be in my first view and i will leave the name as it is i will create one new column and we'll call this um [Music] request id and i will show you how you can um and how you can generate like a good id for each request so that you have only always um like a new id generated and i will leave this as a single line of text since um it will just be like like one line of numbers and letters select save then next i want to have um another single line of text and this will be the requests here the user will write why is he requesting um [Music] something i don't know doesn't matter i'm just referring to one project that i had before so i'm using that that terminology but you can you can reimagine this the way you need it uh on that project it was about uploading an excel file and then the user who upload the file was requesting um a bunch of guest users to be added in the in the active directory so we had like uh the name of the file and then the request id that was generated and then you had the request so the user will write i'm requesting guest users for xyz customer and so on and so forth so that will be also a single line of text since it will be a manual input from the user then we had a person's column which was the the requestor so who is requesting the the new guest users this would be a person or group and everything else we'll leave it as default and then we can have another one which will be a choice this one will be from the approver and this will be the status of the request now we'll have like a new one which will be the standard then we will have um an approve approved and one which is which is declined and by default will be always new so let's select save and um that's enough for now i mean you can you can use as many metadata as you like but let's keep it simple for this demonstration okay so we have our uh document library running now what we need to do next is jump to powerapps and yeah start building our simple upload app okay so now we have our canvas app editor open and i will not do a lot of pretty stuff here i'll concentrate on the functionality of the of what i want to show you but first of all i want to change this background since it's hurting my eyes a little bit um sorry for the german it's because i work in german in germany as well but if you have any questions of what buttons i clicked feel free to put them in the comments and i will make sure that you get the english translation if you need so anyways continuing and i will want to customize one more things this is something i really like to do is i always like to put a header where at the top of my application yeah i think this i know looks like thousand times better than it used to look like as to 10 seconds ago with a plain white screen so what we're going to do next is we are going to put our um columns together as you can see here name request id request and so on the name we're not going to use it from from powerapps this will be put together by um by request id and their request store or request maybe we can decide or you can use like multiple columns and put them together in power automate so that you can have them your name the name also has the extension like that pdf or so on it depends on the document so this is the one yeah which will distinguish your your um your documents as well so we need a request id request and the requester and the status will be that by default will be changed then by the approver so those three and also we need our attachments which is not by default there we will take a look now on how we can put that into our um powerapp so let's begin with a request id and that will need like a label let's put the label over here and name it request request id and then i will put text input which will then be in view mode and i don't want to say that over there but by default i wanted to use the function guide so this one will generate like a default uh grid now for each request that is being submitted okay next is the request we want the user to be able to input his request so let's put that over there right request and let's copy and paste that text input over here remove that and this should be in edit mode so that the user can write something in there next we have the request store which is a person speaker let's put over there our label request star and this one will be a comma box so to use the common box and be able to pick people out of it we need to connect to the data source which is called office uh not there sorry here office 365 users so now that we have connect to the data source we can then go back to our control and usually pops up here over there exactly and then select uh dot search user then the search term and the search term will become from our control here which is the combo box want search text sorry close the curly brackets and the normal brackets and then we should be good to go let's make sure that we have the search enabled there and disable the multi-choice which you can do here by the way the first one is disable or enable multi-choice and the second one is enable or disable search in a comma box so now we can go on and search for my surname oh i know what we did wrong so we are searching by display name but the data showing here is not displaying this looks like locations so let's go here in the fields and edit that and instead of city we want to have the primary text be the display name and the search field search also after the display name this is a common mistake people always forget me included as you notice so keep in mind after putting the data source you also need to change the primary text that the commbox is showing and the search field that will validate in your search so let's give it another try and now we should be able to see some people name and any yeah that's my name very good okay um we didn't create much more columns didn't we yeah the status will be by default new and then we need the the attachment of course as you know in powerapps there is no way to attach a document in a control so that the control is not there by default yet which is a big bummer to be honest because that's something so necessary and i hope microsoft will come up with a solution really soon but what we can do to over do or to overcome that issue is we can input edit form which we do here in the forms and we need to connect to a sharepoint list let's take a look to that now and let's search for sharepoint i'm in the wrong place again here sharepoint and i will go on and connect to one of these sharepoint lists of mine this one over there and this should enable us our attachment control which is over here so if we take a look here now on the forms inside we have all these data cards and the last one is that page attachment data card so what i usually do is i go in here cut this and paste it somewhere here so this is now completely um separated from from the edit form you can see it also here this is the form and this is our attachment data card value so what i would do next is i go on and delete this form since i don't need it and we need to do some modifications here but bear with me a second make it at least a little bit prettier and i want to put a label here as well and i want to call this attach file here spell it and let's fix the issues here it's looking for the parent of course not finding any parents that's why it is complaining let's delete all of that and leave it by default so now it's not complaining anymore at least and what we can do with this control is on the right hand side you can see the maximum allowed items to upload in this scenario we will only allow one item so i will change that to one and the second control is the maximum allowed size of the file in powerapps currently the maximum allowed size is 50 megabytes so i will go on and use that as well maybe users might have like a big excel file or a big pdf file with a lot of pictures in it and they should be able to upload it as well why not but there again i hope microsoft will increase that since nowadays 50 mb is it's not very much and in the future if you want to also to upload be able to upload like images 15b is is nothing for for professionals with a professional camera 50mb uh it's even too small for uh for phones today maybe anyways another subject for another day so uh we have now our control here and if we test it we should be able to yeah as you can see here we receive our um our control to to um to upload a file which which works as it should perfect what we want to do next is after filling out the metadata we want the the application to upload the file currently i haven't found a solution how to do how to patch a file directly to to sharepoint so what we do is we use a power automatic flow to do that and we pass the the data um [Music] the file content uh to power automate and power automate creates then that file in our document library before we do that we need a button so that we can send that data to power automate now let's put it on here and uh let's rename it upload yeah put the label here central let's make it 18 and damn app demo upload docs app i don't know let's name it like that and make it white and make it semivault good now let's jump to power automate and let's create a new insert cloud flow and that's the name and let's name this flow um create file flow and we will going to use the powerapps control but the new one powers v2 so let's create and here we can now use the inputs so first of all we need to pass the file contents this one will use that over there then we have the request id which will be a text all content let's rename this to request id then we can pass the requestor requestor then we have the request i don't know why let's call this request class and then i request her all right quest yeah and then the file will come from here okay that's it that's all we need for our demonstration next we're going to create a file create file not the one drive for business one but the sharepoint one so the site address will be my demo site address the folder path will be the one we just created demo app i think it's called dem app right yeah demo app and the file name will be a combination of the request id dash requester so we can filter on that later on and the file content will come from the file content from powerapps so this will create our file in in the documents library but since we have some metadata so this one here we need to update those as well because the file will be created and we'll only have the name no as you can see here that file name you cannot populate the metadata here unfortunately actually i hope microsoft will change this because it's it's very easy when you create a file and you choose a folder path to to get that metadata that's already been created here it's pro it's actually the same like a sharepoint list when you create a file uh when you create an item in a sharepoint list and we select the sharepoint list it it brings you all those columns right from from from the sharepoint list but when you do it in for for a document library it doesn't populate that so which is pretty annoying and hopefully this will change in the future but for now we can um create another action here update file properties and then go back to my shop on site again the library name which was demo app and the id is the one from the created file item id and now as you can see when you want to update file properties we can see here our metadata we have the title the request id request from the user requests or claims status and description so i don't think that we are using the title so let's leave it empty the request id will be coming from powerapps and it's called request id the request will come also from powerapps the requests or claims will also come from powerapps request store and the status value will be always new so let's save that and um give it a test so let's play this request will be demo request one i'm the requester okay so this is now saved let's um give it a test but before we do that we need to connect of course to our power automate flow and to do so make sure to select the upload button because this will now trigger the automation and when it says on select remove the faults or leave it it will be removed anyways and go to the action section and here you have power automate this now will load the flows that are in your tenant and are related to powerapps and that's the one we just created create file flow this will now be placed in here get rid of that and if you hold here with your cursor you can see here text text 1 text 2 and so on and text is the request id we can see that from here request id so request id will come from this one text input one so let's write text text input one dot text so that's one that's the first one the text underscore one is a request that's this one over here this is text input one one i didn't even name the labels and the text inputs i'm sorry but uh you should do it better text input one one dot text next one is the requester so the request for it's required is expecting the claims or the email address so for that reason we will write here combo box one dot selected that and then we need to pass the email mail and then last but not least we need to pass the file um so the file is expecting the record as you can see here so let's give it a try with that one let's search for our data card value dot attachments dot value let's see what if that will work it's complaining let's say [Music] so it says that it's expecting a type record and we are passing a type of table so that will not work that will not work let's see what else is in here not very much because all of that is like visuals the only thing we need here is the attachments and after that we have name which will also not help us let's see no it's not helping us further what we want to do here we want to pass the content bytes the content bytes is what what the machine sees from that file right what we see is what excel or word applications translate from that content by its language to a human language or the human understandable language but the machine doesn't need that the machine is the machine language so we can give that to it by transforming the the file into a content byte or getting the content bytes from that file and passing it to the machine so that you can then create the file based on that based on that yeah what's inside you know that content byte and then we can use our applications to translate it into human yeah into human understandable language so content bytes column then we write first data card value 17. that attachments and then value next we want to give it also the name which will be first data card that is attachments that name now closing the curly brackets and let's give it a go so select play demo request one already written let's go here upload a file financial sample and now it says here the maximum amount of documents has been reached because we only allow one and he has also said that it hasn't been saved yet let's make sure that our floor is running okay let's not again select upload and take a look here it has failed so after some troubleshooting i found the mistake and yeah so let's go back to the application here in the let's rename this upload i have to delete it a couple of times so that's a button um yeah so to test it for to test the functionality again but as you can see here i forgot one item and it says here file it's also expecting file semicolon file colon record so what you need to do is after putting the first um this one is the first one come on the first one second one third one the fourth one is file that colon record so here put the file open the curly brackets and then put the content bytes and the name and then you close the curly brackets for the file then you close it for this um yeah for the for the item for the file content for the total and then you close the run and the share the power to might run okay so i still need to recreate the metadata one i had to delete it and recreate the flow so bear with me one second so now let's go back to the application i've up already uploaded here one um one financial sample excel file and let's select upload let's take a look four seconds ago and let's go to my demo app in a second in the demo web library so this is the create file action this is the update properties and let's refresh the library and as you can see here we now have the financial sample [Music] with the metadata that we inputted in the powerapp as you can see here it's not showing the icon because we might have to swap this let's give it another try in power automate let's edit create file let's bring the request id here and then the file name so that it has the extension let's save it and test it with the one just succeeded okay let's take a look now as you can see now we have the icon as well because sharepoint is recognizing at the end the extension.xlsx yeah so that's it folks if you liked it give it a thumbs up um and make sure to subscribe to the channel the second part of this video we will see how we can extract the data from that excel file and put it into a sharpened list for example so that you can do further cool stuff with that information so anyways catch you the next one take care bye [Music]
Info
Channel: Enea Liçaj
Views: 15,688
Rating: undefined out of 5
Keywords: Attachments, Flow, Instant Flow, Microsoft, Power Apps, Power Automate, Power Platform, SharePoint, SharePoint Library, power platfrom, powerapps upload file, sharepoint lists
Id: PW2pBFrnD18
Channel Id: undefined
Length: 27min 46sec (1666 seconds)
Published: Sun Oct 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.