Use Power Automate to upload files to One Drive through a web browser

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
thank you okay in today's video I wanted to show an example on how we could utilize power automate to automate uploading or syncing files to OneDrive website I will show the basis on how to accomplish this and you can expound upon this for your particular needs follow along and let's begin so we have a blank canvas here the first thing we want to do is launch the OneDrive website and log it you will need to install plugins for the particular browser you will be using I will use ads as the plugin is already installed there so we want to launch a new ad browser and go to the sign in page if you expand browser automation you will see a few different options to launch different browser types so we will select the launch new Microsoft Edge let's copy and paste in the sign in page into the initial URL field and make sure you wait for the page to load is turned on otherwise you'll run into some issues foreign [Music] next we need to enter some text into the page we will you use the popular text field on the web page action use browser instance and we will add a new UI element once you click make sure you have the web page you are working on open as it will alt tab to the next window you have opened next the section on the webpage we want to send the text to put your mouse over it on a red box will appear over the field once a Target Field is highlighted hold down the control button and press the left Mouse button to select it it will be added as a UI element and in the text section specify what we want to enter in this field this would be the target email address and then select save so this will enter the email address into that field foreign next we want to click the next button so we use the press button on web page action and add a new UI element so hover over the next button once we add a new UI element and hold down control button and left click it okay all that looks good and hit save so we enter the username and then click the next button foreign if you need to enter the password as well you will repeat these same steps for it as well now let's add this in to close the browser once we're done if we run this let's see what happens so it launches enters our username and clicks the next button great okay okay so what we have now is a browser launch to our OneDrive login page we enter our username hidden X and then close our browser okay so this is our Target directory containing all the files we are looking to upload to OneDrive we will just Target PDF files so this text file should be ignored so let's get these files using the get files in folder action specify our folder path as well as the filter to Target PDF files let's do a sort by name so that way you pull them in some sort of predictable way okay let's save that now these files are going to be stored in our files variable okay great laughs now we want to use these files in our automation folder here let's make sure the folder exists prior to doing anything so if we use the if web page contains action and we check for UI element for our automation folder we add a new element and specify our automation folder right okay so only if our automation folder exists then we continue this is where we can do a creation of the folder if it doesn't exist okay so now we want to click on that automation folder so use the press button action and we already have the UI element added so select that same elephant element element and Save now once we click on that folder there is a button that you press to upload files okay well two buttons it seems the arrow next to upload files and then the files this then launches our prompt to specify files to upload so let's add those elements let's do another press button and we can add a new element and then specify the arrow button save that okay then let's add another one to click on files [Music] [Music] add a new UI element and specify the files button thank you save that [Music] okay let's run a test but first let's disable the close browser so that our browser stays is open let's run [Music] [Music] okay it looks completed but we didn't get our prompt to upload files we can see there is an error message about the element not being found I've seen this before and the issue is how the web pages is playing text because our files menu is a sub menu and the tag changes so what we can do is use keyboard Strokes to get our Target menu when we click that Arrow the files button is auto selected so we just need to press enter so under send Keys we will send the special key to press enter and this is how you simulate the enter key Let's test now and see what happens okay success we now have the prompt to specify our files to upload okay so now we are up to the point where our file prompt is launched so we can just Loop through the files and specify each file name and click OK or rather press enter but if we were to select more than one you can see there our quotation marks around in a name and each one is separated by a space so I wonder if we add these file names the same way if we can simulate a multi-file selection let's give it a try we have our list of files stored in our files variable so let's Loop over each specify our files lists in our values to iterate okay now as we Loop over each file let's send the file name key as an input specify the current item just the name and let's put that in quotes and add a space at the end let's also increase the delay between Strokes to 20 milliseconds save that so in theory that should work let's run it and see foreign all of our file names between codes and separated by a space but let's add a weight of two seconds because it took a bit to open the dialog box to select the files okay great okay so let's mimic with the automation is doing it's opening the upload dialog box multi-selecting the documents and then we need to click the open button but you can see by the blue box around the open button it's Auto selected so really we just need to press enter so let's add another send keys that we'll press enter for us so let's run this and see what it does okay great it uploads but you can see it takes some time for the upload to complete so before closing the browser let's add another week for a few seconds I'm just going to pick a random number of 12 and then we close our browser you can also add and move files this can move the files to a completed folder so they aren't reprocessed if you want to fully automate this or you can add some type of syncing mechanism I won't show how to do this in this video though so let's run this but first let's delete the files as there are already uploaded foreign this again with everything turned on [Music] [Music] let's go over what happens here so our browser is launched and website logged into our Target folder of automation is clicked then upload is clicked multiple files selected and passed from our Target folder then we click enter and wait 12 seconds for the upload to complete [Music] then we close our browser and that's it this video was an example on how to use power automate to automate interacting with a website in a particular way more so than uploading files to OneDrive there are better ways to get this done but I hope you found this video helpful also keep in mind that this can be applied to other websites Google drive or Dropbox or any custom Erp website thanks for watching this has been brought to you by AIP Solutions
Info
Channel: AIP IT Solutions
Views: 4,214
Rating: undefined out of 5
Keywords:
Id: -lu3dZgN0D0
Channel Id: undefined
Length: 20min 57sec (1257 seconds)
Published: Mon May 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.