QTT - Power Apps upload a file to SharePoint and set the metadata

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's quick thursday tip we're going to talk about how to upload a file with power apps to your sharepoint and set metadata at the same time so we've covered uploading files before but today we're going to concentrate on setting the metadata which is a pretty quick little thing but first here's our intro hi my name is shane young with powerapps 911. those guys no not rudolph the we'll sign above them and with today's show we're going to do is we're going to talk about setting metadata in your sharepoint document libraries at the same time you're uploading files so a while back i made a super popular video like 56 000 views type of popular on how to upload files i finally cracked that nut and a lot of people recently had the question around hey how do i upload that file but at the same time i want to set some metadata to that document library so today we're going to dive in we're going to take the app we've already built and we're just going to add in that it's a super quick ad so it shouldn't be very complicated so let's just switch over to my desktop and take a look here my desktop you can see i've got the app open and what we do right it's like hey i want to upload a file so we click on little plus and then we can pick any file so we can do images we can do you know excel files word documents it doesn't matter any type of file work so here we'll just grab this one of uh chewy sitting there we go or chew it with his ears ha poor dog so we're gonna spin it uploads and a moment later it's done and if we click on the launch sharepoint file button there is chewy his ears being held up we're so mean to that poor dog not really chewie's loved anyway so now that we've done that a lot of you followed up and said hey how do i add metadata to that okay so to do that what we're going to do is we're going to go back over here to our sharepoint document library and if we scroll down a little bit we should be able to find so there is chewie's ears right a few seconds ago so we know that's working and so let's add a column to this document library so here i'm going to click on the list settings or library settings not list settings it's all the same and so then down here we'll just go add a column create a column and then we'll just call it file comments now remember my thing about not building these with spaces right that's just what you should do so single line text we'll say okay and so now that we've got that done perfect what we're going to do is if we look right really if you remember from your app the way that this really works right is we go here and say on add file after we do a bunch of json stuff and remember this is covered in that previous video i'll put a link to that or if you're a subscriber at powerapps911.coms training library remember you can just go over here and be like hey give me that file real quick right so go here and then you go right here and you search for upload and then there's the formulas and more importantly there is the app and then as soon as i finish this video down here in this qt qtt section will be this demo app available for download also anyway so back over here um right so we ran this but really the key is that it runs this flow called dl playtime and so if we go to flows i have the flow open and it's just a simple powerapps trigger we do a create file remember the file content we have to do that whole um converted you know base64 to binary but we did that and so now that we want to set metadata what we're going to do is we're just going to edit this flow we go right here we'll say add an action i'm going to search for sharepoint there's sharepoint and so in here there should be something about update a file properties i don't know why i'm going to search there you go update file properties so you choose that you then need to navigate to that same sharepoint site right for me that's powerapps videos and then my library name is uh documents and then for the id section what you're going to do is you're going to use the dynamic content from the create file right so that's the file you just created so grab it and so then now look there's file comments and so we can be like let's test this and that looks good so we're going to say save and because we just did the upload this is why if you're building this at home right you'd want to do the upload as well i can just do a little test and just grab that test we did three minutes ago and it'll reprocess so it's going to upload that same file again which we already knew worked but what i want to see is does it set my metadata you always just want to do this right i'd like to prove to myself that it works the easy way and it didn't fail so if we go over to our document library we'll do a quick refresh and then we'll scroll down here and we'll find chewie and his lovely ears again there it is and we scroll to the right file comments let's test this yeah cool right so you're like machine i don't want to hard code this that's fair so but now that we know that it works what i want you to do is we're going to go back over here to our flow and we're going to delete out let's test this and then over here under dynamic content we're going to scroll down here now a common mistake you guys are going to make and yell at me for is you're going to click one of these you can't use one of these uh pieces because we're already using these ask and power apps so you have to say see more and then you have to say ask in powerapps again so then now there is a new ask and power apps for update file properties file comments all right so that's good we're going to save our flow you'll also notice over here is a little red dot flows like hey things are broken and if you click well if we would clicked it sooner you would have seen that the error was saying you've changed this you got to go tell powerapps you changed this fair enough we're going to jump to our powerapp oh that's powerapps in this window and what you want to do is you've got to go over here to your data or you might have to do view data sources depending on your app but so here dl playtime unfortunately there is not a reload so you have to remove it my app is really mad at me right now that's fair we're going to insert a button now and so when we insert this button we're going to say action and power automate and then somewhere in this hot mess of hundreds of phones that i've built i got to find that same flow again right you guys probably are not going to have 200 of these but maybe you do i hope you don't so there's dl playtime unfortunately there's not a search so you find it so this is going to add it back as a data source into our app and so now that it's back in there now just delete the button you just added up here that's gone if you look at your data sources it's back in yea but you still have an error and the reason for that is because if we look here you're gonna see an error you guys see a lot right and valid number of arguments received two expected three that's because we said we're asking powerapps for three things now right we just created a new one so go after the two that were there do a comma ah now it wants the file comments well cool so what are we gonna do how about this we'll just grab a cute little text input right here we'll throw it on the screen that'll work we'll go back to here and we'll say all right i want you to send over whatever is in text input one text input one dot text so whatever we type in there will become the file comments cool all right so then maybe you know at this point right because it's a quick video right i can't go into all of the like making it pretty and stuff but just keep in mind you could disable this right so if you didn't want them to be able to upload it when they did a comment you just do some of your normal conditioning formatting to make it so that people couldn't do it we'll also get rid of the default text here but now if we do play we'll do this we'll hit the little plus and then how about we'll search for chewie again oh i got to pull this up so you guys can see the whole thing sorry there we go we'll search for chewy oh not on my yeah we got chewy and then chewy naughty right a little little christmas theme remember and i keep showing you guys um images because they're fun but you could be doing this with any file type don't don't overthink that so chewie naughty will say open oh see it says i messed up my logic right so i didn't do this the way we wanted to because we just sent over the word text input but if we check over here now we should be able to find do a refresh scroll down and find chewy naughty there it is a few seconds ago and if we just highlight it make it easier as we scroll sideways so it did text input all right let's do one more test because i screwed that up and be like chewy looking good there we go and the other thing i didn't like was that this was on top of my spinner so i would just grab this and take my spinner and say hey you i always want you at top so bring that to the front all right so we got that we got that we'll click on this and now we'll just find another chewy picture here to scroll down here chewy where are you there you go chewie sitting on the couch chewy looking good so that should just upload it if we click on this this should show us our file perfect and if we go back over to sharepoint we should have somewhere in this hot list i'll just do a refresh again and so there's image 4749 right because that one did not have a nice name and then chewy looking good i don't know if you want to have them set a file name and all that you can add all that but the key thing i want you guys to take from this was you already knew how to do all these pieces you just had to take after you create file step and add update file properties you could update as many file properties as you want you can do whatever you want once you kind of realize that you created the file and you know the id do updates email people links to it whatever you guys are thinking you can do here so hopefully this helps hopefully this cutie is exactly what you're looking for just a quick little answer to all your solutions i hope you like my christmas decorations alright with that i'm going to say thanks and have a great day before you go be sure to click on the subscribe button over here so that way you'll be notified when new videos come out if you need any help or you want to work together whether your problem is big or small check us out at powerapps911 we do it all i rhymed or if you're looking for more formal training offerings we have those linked up here somewhere so check them out thanks and have a great day
Info
Channel: Shane Young
Views: 31,811
Rating: undefined out of 5
Keywords: Shane Young, powerapps911, PowerApps, Power Apps, powerapps upload file to sharepoint document library, powerapps upload file, powerapps upload file to sharepoint, powerapps upload files, powerapps upload file control, powerapps upload file to sharepoint library, powerapps upload images and files to sharepoint library, powerapps upload multiple files to sharepoint, upload files powerapps, powerapps upload file with metadata, sharepoint update file properties with flow
Id: e0kMjb686tc
Channel Id: undefined
Length: 10min 5sec (605 seconds)
Published: Thu Dec 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.