2 ways to upload files to SharePoint using Power Automate Desktop

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there it's graciella here in today's video we're going to learn how to upload files to SharePoint using par automate for desktop there are two ways to achieve this and the approach that is recommended will depend if you have a premium account or not if you have a per automate premium account or a trial enabled you will see these options and you will notice there is a SharePoint option there but if you don't have a premium account then we will have to use the file option available at the top for this use case we are going to be working with this link once we go to this link a PDF is downloaded and that is downloaded into our downloads folder as you can see here it's important to know that I have set up my Firefox to download PDF files instead of showing them and also to download the files directly into this folder without asking me if you want to know further information about how to download files from the the web using power automate we have a video on that so we're going to leave it in the description of the video so you can have a look so for this video we're going to focus just on the SharePoint part so let's open part automate and I already created a new flow and what we're going to do is I will just start an instance of a browser and I will ask power automate to go to this link and that will automatically save my file so while it saves I'm just going to wait uh because it takes like a couple of seconds for my file to be there so I'm going to wait 3 seconds and then finally I am going to close the browser and this will take care of downloading my file we also need to access the most recent file there are different ways in which we can do this we know that the name of the file might be different so for example if I download the same file again it will just add a parenthesis and a one at the end so we don't always know what's going to be the name of the file we just know it's going to be located under the downloads folder so what I'm going to do to extract where my file is is I'm just going to get the most recent file that is available in the downloads folder because the most recent file is the file that I just downloaded so what I'm going to do is I will use this folder option and I'm going to use the get files in folder option so here I will select my down Lo folders then hit okay and then I'm going to say that I want to filter by PDF because I know that my file will always be in this format then really important to click on the advance options and then sort by creation time and we need to also select uh the the sending option because we want the most recent at the top then let's sit on Save and what the and what this action will do is it will go to our downloads folder and store the list of files that it has found in this files variable so um the way that we can see which information this files variable is bringing is I'm going to add this for each really quick and I will just select that I want to see my files and that each file will be stored in this current item variable so then I hit on Save and for now I'm going to use a set variable option and when I do that I can click on my varibles selector and I open the current item you can see that current item has a lot of different attributes the attribute we are interested in is the one that is called dot full name because that's the one that brings the full path plus the file name that we want to work with so I'm going to just click on this and for now I'm just going to hit save we are not going to be using this step five six and seven I just created them so I can see what's the name of the attribute that I'm interested in now that we know that the list of files is here we are going to start working on how to upload to SharePoint with a premium account so to do that uh we know that SharePoint works with binary formats if I open the SharePoint options I'm going to see this option that is called create file you're going to see that the first thing is going to do is going to get my connection references if I have never used SharePoint from Power atom desktop this is going to show me an error and I will have just to click on connection references and then just add a new connection reference in this case I already tested this scenario so I already have SharePoint connected so it recognizes everything and here we see this the very same options that we would see from Power automate Cloud we see which site address we want to save on we see what's the folder path we see what's the file name and we also have what's the file content however this file content expect the expects the content to be in binary format so we need to First transform our file that we just downloaded into binary and then send it to SharePoint so let's just search for the binary option in the search bar in part automate and let's drop this option here into the binary into the canvas the way this action works is that it expects you to just select what's the file that you want to convert to Binary you can see here that I just selected it using the file selector and it just shows the whole uh path in which my file is saved so what we need to do instead of hardcoding this file name in the folder we want to get it from the files list that we got in number four so what I'm going to do is I'm going to select the variable selector and then I'm going to select files when I select files this is selecting all the list and remember that we are in Intercept in just the first element so to do that we just write those two square brackets and then we write a zero once we grite that we have obtained access to just the first element instead of the whole list so then I'm just going to write a DOT and remember what's the name of the attribute we are interested in because that's the one that has the full path plus the full name is this one called full name so I will just write full name here and then I and click on Save and after I have done this I really can delete these three steps because the we only added these three to see what are the attributes that we need to work with so I'm going to delete it and then I will go ahead and just add my SharePoint action once I add my SharePoint action I can just click on create file and this is going to recognize my SharePoint sites that I have that I have access to I'm going to select this one and then it's going to ask me where do I want to save it and then we are going to assign a file name in this case we're just going to save it as file pro from for automate desktop and the file content just needs to be mapped to Binary data which is the one that we just created and then we hit on Save and now let's test our whole workflow so now it has uh entered to download our files we can see that it out downloaded it with the number two and then it accessed the file it converted it to Binary and now it's supposed to be in SharePoint so let's open SharePoint and let's save this and you can see that now we have this file from Power automate desktop here and it was just uploaded a couple of seconds ago and that's how we can up upload files to SharePoint if we have a power automate premium license now before moving to the next option let's have a look at these files variable and you can see here that the most recent file was brought over it it's the one that has the number two and if you click on more this is another way in which you can see what's the name of the file so you can see that full name has the full path and that name just has the uh actual name so if you wanted to bring everything to just bring the same name from the download to SharePoint we would just need to uh change this file from pad to just um file zero and thename and if we execute it then it should just add a new file with the name that we just um have from our files downloaded and if I go to SharePoint you're going to see it's going to be there and here it is it's the most recent file that we downloaded and and now it's available here so now let's move into the second option which is if you don't have this premium account for now I am going to disable these two options because those are for the uh trial or the premium account and what we need to do is to sync our SharePoint folder into our local computer because we don't have a premium license so we can't access the cloud at least from here what we can do instead is just syncing this SharePoint folder to our local files and what will what that will do it will just prompt you to sign in and then you can sign in and once you sync the files you're going to see that this folder is going to show up on this side of the screen and anything that I put into this local folder in a couple of seconds will be just synced back to the cloud so we are going to be taking advantage of this syncing to just move our files inside our local computer and this will add automatically push the files to the cloud please note that there's also an option to use the SharePoint API or the graph API using this option that is called HTTP however that is a little bit more difficult compared to other options because this will require some additional knowledge on apis so we're going to be focusing on the other option that takes advantage of the sync options we're going to get what's the most recent file and then we're just going to move it to our local folder that is synced to SharePoint and then we are going to just let one drive do its thing uh and then the files will be just showing up in SharePoint so what we're going to do we're going to keep this same step because we always need to get the latest file so now that we have the latest file we just need to use this option that is called move file or files so I'm just going to select it and put it here and what we're going to do it's the same thing we we are going to select the files and then we are going to select the most recent item which we know is item zero and then we are going to select full name and then it will ask me what what's my destination folder my destination folder in this case will be the folder that is linked to SharePoint for now I am going to select uh for now just any folder and then I will go to my SharePoint folder and I will open one of my folders and I will just put it it here and that way we know that this folder is synced to SharePoint so everything that we upload here it's going to be uploaded as well to SharePoint and finally we just need to select what do we want to happen if the file exists or not in this case I'm just going to overgrad it and then hit on Save and now we're going to run it and we're going to see how it downloads the file how it save it into our default folder and then how it's moved back to SharePoint and then to the SharePoint folder that we have in our uh local computer and how that will push to the cloud now if I go it seems like it finished if I go here you can see that the most recent file was moved and this automatically moves the file with the uh name that we had and you can see now it's syncing and in a in a moment the file should be just uploaded to SharePoint yep now you see it synced and now you see it's here as well and that's it that's how you move files to SharePoint from Power atom desktop depending on the type of license that you have thank you so much for watching and see you next time
Info
Channel: Power GI
Views: 4,232
Rating: undefined out of 5
Keywords:
Id: gQobr4zWk4s
Channel Id: undefined
Length: 12min 40sec (760 seconds)
Published: Mon Dec 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.