Power Automate - Copy Files from One SharePoint Site to Another

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what up guys what up what up guys so in this video uh we're gonna be talking about how to move files from one SharePoint to another SharePoint so this is all going to be under the same organization but you're moving files from one SharePoint to another to another SharePoint under the same organization so I got a request from a viewer they ultimately asked hey how do I move file from one SharePoint to another SharePoint under same organization uh but with python so I'm going to show you an easy way to do this through Power automate now I am going to make another video that's going to show you how to do it using python by all means because there may be a need to do it through python but you know power automate is able to do it very easy very quick and uh yeah guys so that's kind of the purpose of making this video before we get started guys hit that like button give me a follow man I appreciate it give me a follow and on Twitch uh Twitter on my other social media platforms as well guys I appreciate it and let's get started okay guys so I have a I created a new flow around that was empty I don't have nothing to it right so I'm starting from scratch and ultimately this flow the way I'm gonna build it there's there's a few ways you there's a few trigger points you could have you could have a trigger point based on a new file right and then when a new file gets dropped move over in this case though we're moving over files like many files from one SharePoint folder to another so what I have is I have this the level per site which is called the level upper and then I have this folder under data 2022 cells so I have all these files in here right so let's say you got 50 100 it doesn't matter whatever how many files and I'm ultimately I have another SharePoint side that I call production which is this guy um and I probably moved over file let me see oh no it's empty so either way the plan here is I want to be able to move all of the files from the levelment over to production that's all we're trying to do here right move it over so two different sites uh the the structure it's kind of the same pass but it doesn't have to be you know it could be a whole different pass it doesn't matter um this something of this sword would be ideal right if you're uh for example maybe you got a site that's going to get decommissioned gonna get shut down and maybe um it's gonna get split up to like multiple SharePoint sites so now you need to move files over you know instead of having to try to download everything manually and then upload everything manually to the site and you could do what I'm about to do right which we're gonna have to create a power automate flow to go ahead and move that over another scenario would be you know if you have a let's say production um SharePoint site to maybe your files that being dropped in because it's production you know operational files um you know sales reports things of damage right you know different data files maybe being dropped in or maybe there's Excel file that users are entering in data you need to capture that data and you're trying to do some testing on it but you don't want to test against a production site you know so you could have something like the way I do right I have a development site and then you can just copy over those files over right you don't have to delete the file just copy over the files that you could be testing with real files but without really interacting right with the production environment so there are different use cases it depends on what your use use case is but again this came from a request from a viewer so that's the whole purpose here so let's go ahead and get started because we need a trigger point and for me it's going to be a um a schedule of uh reoccurrence right so maybe like once a week I'm moving over files you can do it once a day just depends on your your use case um so let's go to schedule this is going to be my trigger and recursion so that's what I'm looking at I'm going to change this to one uh week and then I'm going to say my time zone I'm Central so I'm going to do central time Central America or Central us you can specify a specific date and time uh for example like start time but in my my case I'm not I'm not going to specify I want this process to run it's a Sunday and then I want it to run first thing in the morning Sunday which would be uh midnight pretty much because it's am at that time and then of course the minutes would be uh zero right so again it will run at midnight Sunday pretty much okay so now my next step is going to be let me find SharePoint so I need to get a list of files so there's different actions one of the actions is called get files so let's call a git so you got get file properties only and then you have of course get file but again I don't want to get file file it's singular I want meaning this is get file as well I want to get files right so I'm gonna go ahead and put and get files I'm going to specify the which site so in my case it's going to be the level mid site um under Library we're gonna be under documents at least in my case it's under documents to write yours could be something else then I'm going to be and then I'm going to specify I'm going to be more specific which folder so in my case it's going to be data 2022 and then sell let's see and that's it so now after we after I got that I'm going to hit the next step through the thing this is giving back think of it as we're getting back a list of files that belong in that folder right so since we're getting a list back we're going to need to do some sort of iteration over that so that's where I'm going to go to control and it will be applied to each I want to iterate over each item in that list okay the first thing that I'm going to so if I click on or select an output from previous step so in this case is going to be the value list of items this value contains all of the items for like details properties for my specific file ultimately right then I'm going to go to action items and in this case I'm going to go back to SharePoint now I'm going to do a specific eye action in this case I want to copy files over from one SharePoint folder to another SharePoint folder so I'm going to search copy um there you go copy file right not FiOS it's copy file so I'm going to click on copy file I'm going to speak I'm going to pick the um the site that it's going to come from which is the development site then I need to specify the the pass so in this case if I click on it and it will if we look to the over here to the right um there is a what is called Full Pass is there we go uh Full Pass let me move it up there it goes my face in the way see how we got this full pass this ultimately provides think of it as the URL for the full pass so it has a site but this provides a remaining piece that to identify which file we actually are going to be getting so as we're iterating over that list this Full Pass item is giving them back the URL to know um you know which file we're copying over record copying every file one by one that's what that's doing next we need to specify where it's going to go to so you don't see production here and it's because I just created it and it takes like an hour so I have noticed anytime you create a new site it does it automatically reflect power automate I'm not sure why but I'm assuming it's because they haven't propagated down to another um another um either the metadata or some sort of um table or something right something just hasn't you know uh recognized it yet in power automate so but it normally takes about an hour or two then eventually that'll get resolved so for now I'm gonna have to copy it copy in the past manually but nevertheless it feels recognized that you would find on your drop down list so if it's if it's a um uh let me try again destination oh I gotta hit enter custom there you go boom so once I enter in custom now I could go to folders and then I could find under shared documents data 2022 and then sales right so I'm pretty much moving it to a folder with the same structure right in my case your case could be something different and then there's an option here if another file is already there you can determine what you want to do do you want to copy with a new name you know fail the action or replace my case I'm going to do replace I want to replace it and really guys this is it this is how we're doing right it's on schedule run once a week we're getting a list of properties file properties from a specific folder in SharePoint in this case the level mid SharePoint we're going to iterate over that list and then we're going to copy it from one the level measure point over to the production SharePoint that's all we're doing so now if I go ahead and hit uh save all right I saved it and let me come back and we could go ahead and run it so let me go ahead and run this process uh run flow and you'll see down here in the history right it will tell us that that it's running as you could tell I ran it 23 minutes ago so I did run it before that and it failed figure out what the issue is fix the again it's all about testing so those of you who are just runs there's a lot that entails in making a video sometime I may make a video that maybe 10 15 minutes long but there's a lot of work before that before the video sometime it could be 30 minutes of testing doing some research sometimes dude it literally could be a few hours of testing and doing research for a 15 30 minute video um so just kind of putting that out there right I know some sometimes the video may seem like oh that's you know it's it's not a long video so it doesn't take that long but some again sometime it takes longer than what it seemed just because you know come across some issues and then got to figure out why is this happening and sometimes it's something stupid sometimes it's something legit just depends right so I do appreciate the support guys all the support you are getting you know follows likes again you're more welcome donate to my channel if you like what you know things of that nature um do appreciate it all right cool so it succeeded uh so now let's look under the production boom there you go see production earlier when we saw it was empty as you could tell these just got added added about a minute ago so all of these just got added automatically now we did not delete them from this folder because I was doing is a copy right now if you wanted to delete them we could do an action for that but in this case what we're trying to just copy files from one SharePoint folder to another SharePoint folder now if you need to do something like that of course I would recommend again I'm a python guy I code in Python all the time but sometimes using some tools that are out there like in this case power automate dude would handle that very swiftly man so strongly recommend to use the right tools for the right job right so but either way I am going to be making a video using python hopefully this helps out guys again I got a request from a viewer I'm going to be pushing out more and more videos coming soon um I will be making a video related to what I just did but using python to do it because the original request was Hey how do I move files over from one SharePoint to another using python um so I would be I am going to be doing that uh I am going to make it another video on how to move files over from one SharePoint to another organization SharePoint so I am going to be making a video related to that I would say that step be it's very easy to do or a lot easier in my opinion to do with python because literally would be two sets of credentials one for one SharePoint site one for another and then yeah it wouldn't be an issue at all for power automate uh I need to play around with it to see you know how to authenticate right with another SharePoint but under a whole different set of credentials uh either way guys hopefully this helps um again appreciate all the support give me a like give me a follow and um talk to y'all later guys peace
Info
Channel: I am Lu
Views: 11,813
Rating: undefined out of 5
Keywords:
Id: gMvYIXEGOTk
Channel Id: undefined
Length: 14min 22sec (862 seconds)
Published: Sun Nov 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.