PowerApps upload file to SharePoint document library without Workflow with Custom Metadata

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to my YouTube channel tips by Anil so in this video we will see how we can upload a document in document Library without any workflow and we can create also update a custom metadata against a document file okay so here if you will see I created a document library and here you can see this document type column I created custom okay so in that value is like document type jpg PDF Doc and Chip okay so suppose I will delete all the documents and here is the application and I want to attach a file from here suppose going to attach this file and going to choose PDF and click on upload so now yeah document uploaded successfully so once you will refresh this page you can see the file has been updated and against that a column document type that is custom column as PDF has been updated directly okay so how we'll do that to do that let me back to my upload button so in this upload button first of all I let you know that this attachment control you will not find any viewer in this insert option okay we don't have any such kind of control here if we'll try to search it you will not find it out how we will do that first we'll have to create a connector with a SharePoint list so issue tracker is my SharePoint list that is created in my channel tips for Anil hyphen theme sites okay now this issue tracker list screen 2 and in the screen too I created a form let me create a form for you so this is screen 2 and here I will insert a form that edit form and now here I have a data source for a suit issue tracker I'll issue tracker here once this issue tracker will uh connected with this form you will see the attachment control just copy this attachment control and paste wherever you want okay so suppose I will paste here now this control has been pasted over here now we are getting few errors these errors will have to remove okay remove all the code that's giving you the errors all right now this control is ready for the use so this is the same control we are using okay this is our first step and the Second Step here I created a drop down and in this drop down if you will see here I attach like I created a table and in this table I choose PDF jpg and Doc okay so these three value I can see in the drop down list all right now in the upload in the upload if file expand it so here you will see for all we created a loop because in the attachment control user can choose multiples attachment okay so attachment control name is attached control see here okay and Dot attachments and we have a another connector Office 365 groups dot HTTP request and this URL or the concept behind this URL we will just discuss in this video okay and after that this is the method this is the loop that is going to insert the document in document Library directly okay and here we are refreshing the document Library upload doc the same document library and after that we are trying to get the last record okay the last ID of this document library and on the last IDE we are using the patch function okay so here we are updating a document type custom column and we are providing a drop down value selected DOT type okay so the concept is because in the document Library the concept is first you'll have to upload a document first here you will see the file and after that only you can update your custom uh metadata okay you don't have any such kind of uh like uh options like a similar like SharePoint list that uh if you're creating a item against the item directly at the same time you can create attachment as well but in the document Library attachment is first and after that custom metadata okay so this data name modified and modified why this is the default data that created with the uh document but the custom metadata we are updating once the document will be inserted okay now this URL how we are we are creating this URL so we'll have to go on the graph Explorer just type in the Google graph Explorer so this is Microsoft graph Explorer you will get this URL and after that just click on run query and here I have logged in already if you are not logged in you just can log in here and here you will get all the data my display name okay given name all the information whatever you are you having in your title now sometime uh that's a this point I'll let you know uh here first we will discuss that this graph API so in this graph API you can see HTTP request to upload a new file so you can see put sites site ID drives item parent ID file name and content okay so first we'll have to find out the site ID then parent ID means the ID of the uh ID of the document Library okay so to find out the site ID what I will do here just type the site so we having this graph Explorer okay the same graph Explorer so suppose if I'll type here site then go in the SharePoint site section and here you can see get SharePoint site relative path URL okay hostname server related path now here I will provide my hostname this hostname okay let me put this hostname just remove this https okay now remove this uh as well and here we having server related path so what is the server related path so that is slash sites and my cell related path okay now once you will click on run query you will get this data but sometime you will not you will not get data you will get some kind of errors and to resolve that error just click here and click on consent to permissions and here uh it'll have to provide few permissions like on API connectors and here you will have to just uh read or write permissions so whatever whatever things you are using that kind of permissions you'll have to provide here so here for the files I recorded the read read all selected and read write okay so these permissions you have to you will have to provide here for this user now we got this data okay we got this site ID so this is my site ID now see here the first step cite a get site ID so this is the URL for the site ID okay now we've got the site ID this is my site ID okay so let me put the site ID here and now get doc Live ID okay how we'll get the document ID so let me here you can see my organization default enumerate the document Library under the root side okay so instead of root we will paste our site ID click on one query here you will get all the document library that we having on this uh uh tenant okay now if you will see upload doc this document Library will be having now this ID I need to copy okay and I will go and I will paste here okay this is our second step now go to Doc live root so for dog live root what I will do you can see here we having this URL drives okay and after that I ported my ID here my document Library ID here okay document Library ID and slash root click on run query now we are in the root finally what I will do see here we having file name and content okay so that file name and content I will add here okay so this is our complete URL you can see file name and content if you want to see you can see the same URL okay file name and content so file name we are providing Dynamic This Record dot name so this record is basically picking the data from this attachment control dot attach okay this is record.name and this is record.value and same URL if you will see here you want to match the URL I will copy and paste look this URL scene and the URL that we are using here C you are the same just we are doing this record.name and contained and after that one more thing we this is the portrait request see here okay this is the put request so we have created this put request and we are creating in for each Loop for all Loop okay so this is the concept behind this now once the document will be uploaded then instantly we are refreshing this document library and we are getting the last record from this document library on that last record we are applying a patch function here to update that document metadata that custom metadata okay so now if I will run run this C click on attach file and click on upload once you will click on upload first this document will be upload then it will take the last ID of the uh record then instantly it will update this document type so this is all we have discussed in this video like uh without any workflow how we can upload a document in the document library and engaged how we can update custom metadata okay so in this video I created only one column if you want you can create multiples column you can add column here and you can add controls here and you can apply the patch function so in my patch function here if you will see I use only the single column like here but if you want you can just copy and provide a semicolon sorry a comma and provide the value here so here you can provide the column name and here you can provide the control name on which you are storing the value okay so I hope you like this video and if you like this video then please subscribe my channel thanks for watching my video have a nice day bye bye
Info
Channel: Tips By Anil
Views: 3,515
Rating: undefined out of 5
Keywords: powerapps upload file to sharepoint document library
Id: bC6DUAhFbLA
Channel Id: undefined
Length: 13min 41sec (821 seconds)
Published: Sun Apr 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.