Update File on SharePoint using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone this is daniel and in today's video we're going to talk about update file on sharepoint using powerautomate so just to give you a little bit of a synopsis um there's a scenario where you will be getting emails and there's a link on that email and currently you have to manually click on that email link download a file and then you upload that to sharepoint well thanks to the magic of power automate i'm going to show you how we can automate the whole thing where power automate automatically clicks on that link and it uploads that file to a sharepoint document library and if in that scenario where you already have an existing file it goes ahead and updates that too so now that you've understood the gist of this blog over here i'm going to walk you through that but first here's my intro [Music] so this was actually a real world scenario so i'm gonna actually walk you through a conversation of how i even get got to this point over here so what happened was somebody and i'm gonna give that person a name i'm gonna call her sue sue actually reached out to me and said that hey daniel i have a daily task which i think power automate can well automate it so can you help and i was like hey sue sounds interesting uh what do you have in mind so she came back and said i have an email with a link to a document that comes in daily i'd like to download that file and have it uploaded to my sharepoint document library basically she just wants to automate that process because it's a mundane task that she does daily so i said sure do you need to type in a username and password to simply click on that link because i wanted to make sure that is there an authentication process which requires manual intervention but the good thing is sue responded back in saying nah i just click on it and it automatically downloads so my response to that was gotcha yep that's definitely doable we'll need but we will need some additional license for this uh we are microsoft 365 or m365 alone won't be sufficient so are you cool with that and sue responds back saying yeah i'm cool with that uh just one more thing i get an email every day so i'd like the flow to simply replace the existing file that i have and is that possible and so i responded by saying well that does complicate things a bit but i think we can accomplish that so when do you want to get started so that was literally a conversation that i had and it was thanks to the power of power automate we were able to successfully accomplish this so based on that conversation the key takeaways were that first of all i need to trigger flows using incoming email so that's the big thing second thing is we will have to make an http call and because http connector is a premium connector we will need at least a flow user one or a powerapps user one plan at least that's what we need over there second is have a sharepoint document library and because sue came back with that requirement is that hey if there's an existing file already there then i want you to update that and because of that one big reason we need a temporary folder over there so because now we talked about the scenario i want to actually talk about the main actions in the flow that we'll be using and the first one is html to text because there's an email coming in and the link is in the body of the email so what i'm going to do is i want to first convert that html body of the email into a text and for that we're going to use the html the text because we'll extract the url from the text second thing is we're going to use the http action over there now again i call that before that this is a premium action over there so you need to have that additional license over there next is the sharepoint create action because this one is we're going to go ahead and take that file and we're going to create a file by create means that i'm going to just take the file and add it and that's the one the file that we got from the http request and remember that scenario where she said that if there's an existing file i want you to go and replace it well the create file doesn't have that option over there so we're going to temporarily store it in a temporary folder location over there and then afterwards we're going to use the sharepoint move because the sharepoint move allows you the flexibility to take that existing file from the temporary location and when we move it to the actual destination folder there is that option over there called replace and that's going to be the big and the main reason why we do that so let's i mean now that you know about the actions over there the four big actions i want to do spend some time specifically on the most important expression that we'll be using and that's the split expression over there expressions are basically a type of formulas that you use in power automate flow so what you see over here is actually a good overview of the email body and the reason that you see over here you see that download monthly report over here that is actually the link but when you do the html to text transfer that the beauty of it is that link is extracted from there and it has gone ahead and put it inside the bracket so initially in the you know the uh the rich text or the html body you would have just seen monthly download with an under underline over there which is actually the url but once you extract it to text this is also what you see what they're very very important piece so that's why i say email body in plain text next what we're going to do is we're going to use the split body and the split function is we're going to split that email body and we're going to split it based on the close bracket which is this one over there closed brock you know the box over there so that's why once you've done that it breaks it down into actually two sections this first section is one section because it's split up it's split based on this close brackets over there or the closed box so this becomes one section and then this becomes right section so the first split function that's what it does but i'm going to take that split and i'm going to put it inside the first function so have you noticed the difference over here this is what it seemed before but i took that and i added inside the first so the yellow piece over here including the close brackets that's a new piece and what i'm saying is that whatever was the first chunk of the split that's the one i'm going to take away so let me go back before us there were actually two sections right there was this one which is in the light blue and then this one which was in the yellow now are using the first i've only captured the first section of it so it's kind of making sense now is that how i'm taking that main email converting that into just the text and then i'm starting to split it and that's the split function that i'm using and i'm using a combination of split first and last to just get that url so let's continue that because we don't stop over here there's still a lot of stuff that i need to clean up so i did the split i went and picked up the first but the next thing that i'm going to do is i'm going to do another split now i got to do another split left on the opening box over here because that's the only thing that was left so now once i've used the split um with this opening box now i'm going to break the text down into two more sections the initial piece which is all in yellow and then the remaining place piece which is all in the blue so when i did that and i went ahead and now said that okay i've gone ahead and done the split i just want the first section i mean the last section of it the last section being this last section so now that i've gone ahead and grabbed that thanks to this combination which was initially split then getting at the first section of the box doing another split based on the closed box and then disc in the last piece i finally got the url that i needed so again just as a recap the key thing was that i had to go and convert the html to text that's how i saw the url the url came inside the body so it came inside the body which was the opening of the brackets and closed up opening up box and closing out the box and then using the combination of the split and the first and then another split with the last this was the full formula that i used and i finally got that url so this was actually a main you know one of the big features of this entire process that i'm going to show you so now that you understand the whole thing is the actions that i'm using and the main expression let's actually start building the flow all right so i'm going to get out of my slide deck i'm going to close this off and what i want to show you is the actual email that's coming through so i'm getting email from this user and this is literally the body of the email the subject says monthly report for your purchases it has a dates time to it there's a little bit of a body and there is that url see that url which i talked about the one we're going to have do some magic with that's what it is and then finally this section now here this piece is all part of outlook so it didn't come with the email literally what came in the email was the subject the two and then this was the entire body so those were the main things i'm going to go ahead and you know initially delete this because when we do an example you know we don't get confused so let's now jump into my flow piece over here and let's start building that flow so i'm going to go over here and i'm going to click on the instant from blank it says live demo of extracting url from email um and it is going actually not for right now let me just highlight that ctrl c i'm going to skip on it and i'll paste that name over here and what i'm going to do is i'm going to go ahead and capture office i mean you use the office 365 outlook if you don't see that just type in office 365 and this is what you're going to see all right now the uh example that i want to walk you through is basically using the the initial trigger is when a new email arrives and now i'm using the version three of this the v3 um so go ahead and you do the same as well if you don't see that there's two ways to find it click on the see more and then you can scroll down or you can just go ahead and you know search for when a new email so it'll show up over there but since the list is small it just shows up so that's what i'm gonna do grab that now let's think about this for a minute we are triggering this flow when an email comes in now if you are an user which is pretty much a lot of people now if you get tens or hundreds of emails in a day for every email that came through that email is good i mean that flow is going to trigger and you don't want that to happen because that's going to cause a lot of work for you or confusions for you plus that this flow can just go rogue just like that so we want to kind of put in some conditions so in addition to selecting this trigger i'm going to go and do click advanced or show options over there i'm going to use this section on that all right so the first thing is when i came in and i saw that email it actually came from someone called gabriel christian and we had his entire email address so take that email address when you're you know trying to use this take the email address of the two person and put it over here so i know who that person is and that's why i'm going to go ahead and type that person's full email address over here and this is what it is it's coming in from here now also who is it coming to i mean i apologize it's not the two it's coming to me so i gotta get my email address over here made a silly mistake over there don't make that mistake just make sure that two is words are coming too and that gabriel from who it's coming from that comes over here made a little mistake over there but hey you know what i was just testing your uh the knowledge to see if you're really paying attention right just kidding i made that mistake okay so now the subject now the subject of that email that came in that was important one okay so i'm just going to go and grab that again just so that we see it the email that came in was basically just telling me uh go back to deleted items this one that was the subject subject says monthly report for your purchases so i am just going to grab this section of it because what happens is sometimes this date can keep changing it appears to me that the the date stamp is always based on the month so what of next month that dates time changes which is why i can't go ahead and keep taking that because that's going to change which means i want to keep my flow as dynamic as possible so i'm just going to take the first section of it so therefore the subject it says string to look for in the subject line it's not saying that the exact string is just saying i need a string to look for in the subject line so now i'm going i'm just going to go ahead and take that first chunk of it and i haven't added any of that date so this three combinations really helps to monitor the email that's coming in but only run the flow if these three conditions are missed the condition is who is it going to well it's going to me so that we went and put that into who is it coming from it's coming from this external user which is gabriel christian in this case over here and then what's the subject filter the subject filter is having that section over there so this three combination really did the great job over there all right now let's go to next step over here or the new step and now we're gonna look for the html2 text now if you remember in my slide deck that i showed um html to text it's basically this one over the content conversion html to text it is in preview but trust me you can go ahead and use this one over here it treat what we're doing in this html conversion is actually going ahead and the body extracting the url from just the text and that's how i was able to get that url inside those two uh box brackets over there now that was inside the body so i got to go over here and i got to grab the body which is right there the body of the message all right and that's all i want to do is i want to go ahead and get that text i mean run got the trigger and i want to grab that so this is actually a good point for me to now save it the second thing i'm going to do is i'm going to intentionally add it into just a compose function and what the compose function does it's i mean action does is it does serves two purposes um i'm going to be using this compose function and so when i use it to call on the other section especially when i'm extracting the url all i see is just this section of the body and i don't go ahead and you know grab this because this provides me way too much information over here all i'm going to get is i'm just going to go ahead and grab the text version of that body so that's why the compose just helps there's a little bit of cleanup for the remaining steps that i have to do but the second thing is great is that for people like us who are actually building the flow this is a good troubleshooting step as well so in the future for whatever reason if this doesn't work you've already got a troubleshooting step added over there now i also i'm going to go ahead and rename this i'm going to put rename that to html body because this is going to come in handy for the next step all right the naming convention is going to come in handy when i start putting in and expressions and i'm able to identify because if i'm going to add some multiple compose steps over there helps me to understand compose when it is okay so we've got that we've got the compose we see the entire url coming in now i got to go ahead and add another compose because this is where we're going to do the extraction we're going to do the split and the first and then split and the last all right so i come over here and i'm going to now put the um in come on mouse come here and already exists in the expression i'm going to first start with the split in the expression i'm going to first start with split so i'm going to come to expressions over here and i'm going to type in split and their split shows up and if i do an open brackets it automatically closes the bracket but the cursor right now blinks inside the bracket and you see this big distraction it helps you define it but it's also distraction so to get rid of the distraction distraction you with your right key you basically move outside that so you have actually moved outside it and then you bring it back inside and now you no longer see that distraction it's a little bit of tidbit that i'm throwing out over here okay so i got inside the split i need to add this body so once you're inside over here you go to content the dynamic contents and you click over here so that shows up but you're splitting it based on something and in this case if you remember the slide deck i'm first doing the split based on the closing of the brackets or closing of that box so again i click on comma i click on the um the single uh in a separate over here and here is going to be the close brackets so that's is what i'm doing over here all right so the first thing is just i did the split that was the first step in this case what am i splitting it for i want because of the split which one do i want again go back and before you see the first section is i want the you know including the entire url so i'm going to get the first section so i'm going to click on the open other uh brackets over here and i type first and i click on that go back over here and i just close the brackets right so i've gotten out the first section of it i go ahead and capture the entire text before including the url but now what i want to do is i want to do a second split but the second split is going to be based on the opening of the brackets so i come back over here i open up the brackets and i type in another split right there go back to the end and i do another copy i mean comma and here i'm going to do the opening of the brackets not curly brackets the closed brackets and here so i'm going to enclose that but i just want the last piece of it the last piece is the url again i just showed you that in the slide decks if you're a little confused and i understand this can get a little confusing so you pause over here go back before and see hey danny in the slide next you should okay i haven't done split it perfect split it based on the comma yep i got the first chunk now i went and got the first chunk of it um now i got to do another split and i'm going to split it based on the um opening brackets perfect so the first in in introduction piece of the text of the box goes away perfect and then i went ahead and just grabbed the url and to get just the url i use last and close it and i hit ok what i'm going to do is i'm actually going to pause over here and let's run if uh an email i'm gonna intentionally sit over here and through the power of magic i'm gonna actually send an email it's not magic i really have another flow running just send that information coming over here so any second now you're gonna actually see that coming through i'm gonna just click over here go to my inbox we will wait over here and i'm gonna run the flow the flow is automatically running and you will see one show up over here any second boom it showed up over there now this is what the body of the email looks like now let's come over here let's actually get out and you should see yep seven seconds seconds ago it just ran so i'm going to click on that your road flow ran successfully now here's the email that came through remember we went ahead and did some filtering so that's perfect now here is where we did the expression from the html to the text and see that's the brackets that's coming through perfect now we went ahead and captured that into the html body so we see that and now thanks to the whole compose magic that we did the explanation that i walked you through um we just got the url so remember this was awesome you've actually achieved 50 of the work right here because you got the url that's the big thing and the url was the pure magic of split with first split with last and as we were cleaning up cleaning up cleaning up we got this entire just the url over here so you've already achieved a huge step forward over there 50 literally 50 of your work is already done but let's let's continue moving forward all right so now i'm going to come in and we're now going to make that http call now i i do have to want to call it one more time the http step over here is only for premium license the reason i want to say that is it's http it's premium so if you are coming in as an office 365 user with just a business plan or an enterprise plan even enterprise 5 e5 this is not going to work in fact you will probably be still making this flow and so far you may not get any you know messages but the moment you try to run it it's going to say i can't let you run it because you don't have premium license so i want to give you this heads up right up front is if you are going to use this http action over here which we are you will need at least either flow one which is definitely cheaper or you can go with the powerapps plan one and um uh the um you know the app one way or if there's a flow way a flower license or there is an app license both of you of them will give you that uh um you know the flexibility as a premium connectors so i'm just going to click on that over here and then the method is going to be get which kind of makes sense right because all i'm doing is i'm getting the file from that url so get just makes sense now the other thing i want to do is i'm going to come over here and i'm going to rename that compose to extract uh the url all right come over here let's click on that yep it gives me a little error but that's fine so it comes on the url piece and i'm going to use this one so see it's important that you name it correctly because that way you know that which compose it is so and now i won't get confused saying that oh man which one do i use is it compose one or compose two i don't get that confused because i know and the composer i want to use is extract the url so it's very important that you name these all right went ahead and got that gonna save it now the next compose i want to do is just c okay that's all i want to do is i want to see it and again the c is actually helpful for viewing it for the sake of this demo all right and not just for the sake of this demo is when i was building this i was troubleshooting it testing troubleshooting and testing and the compose is literally one of the most important tools for me to troubleshoot and build it so even though if you are as a viewer coming and seeing that you know what daniel really didn't need this html one he actually kind of didn't even need uh doesn't need this composed one so why is he adding it again it's just because of the maker of the flow i want to see at different steps how things are working and kind of get into that habit as well not just to see and and this is fantastic for troubleshooting so i'm going to come over here and this is the place also where you can see the beauty of this http one now when you remember in the slide deck i showed you this big long url that was there and that url had three things it actually had the url of the x of the um the excel spreadsheet or the file itself but it also had the authentication information the authentication information well it had the authentication and it had a timeline and most of the urls that you get with this type of information to download comes with those three things you will have the url with the file list that will be the first chunk the second chunk will also be where the authentication is which is the username and password and then the third chunk will actually be a timeline so a really strong powerful url with this type of information always has those three things once again the file location authentication location and a timestamp sometimes you might even have a cookie number over there or a trigger or a token or something but these are the main three things you know the file authentication and the timestamp over there so i'm going to go ahead and this time all i need is the body and that's the beauty of this http connector is it gives me all three the headers which has got all to do with the tokens and stuff like that and the authentication uh it tells me even the status code the status quo is hey was the connection the talking the get function did that work successfully or did it fail and things like that i just want the body so i'm going to come over here and i'm going to now rename that to say just the body all right and just by habit i go ahead and save that and let's actually do another test so i'm going to come back over here and through the power of magic i already have another flow running over there so i'm going to click over there we'll come back over here let's go ahead and delete this one so we don't get confused i go and run the flow when i run the flow an email is going to show up email showed up over here let's see did our flow run i'm going to give it a second and i'm going to refresh it yep eight six eight seconds ago click on it and now we've got some more things to see um let's just focus on yeah we already seen the url that's nice url over there made the http call to get everything worked but now over here when i click on it it actually shows me the content on the content type and if i actually click on this one over here it'll show me all the information that it's pulling but everything is successful and the information is coming through so that's that's all good right let's keep moving forward now um what i'm going to do is now we're going to start focusing on the sharepoint piece over here so on the sharepoint piece the first thing i'm going to do is i'm going to come over here to add the action i'm going to click on i mean type in sharepoint select that sharepoint over here and we're going to use the create file action and it write it is create file here or you can just type in create and it gives me create file now there's sometimes a confusion over here it's daniel you're putting in a create file but you're not creating the file you're correct uh but technically i'm taking the data from that http and i'm creating a new file into the sharepoint so technically that action name is correct but between you and me and just layman terms and we're discussing you're absolutely right we're not creating a file we're kind of just you know uploading a new one or adding a new one all right so what i'm going to do is i'm just going to go ahead and take care of my stuff uh come over here if i don't see my url i'll just go grab that url um so that i don't see it let me just go over here go to my file location i'm in my sharepoint site let me just go grab that url and come over here enter my url and in your case it might be just you already have the url so you don't have to go and do all the extra magic that i did what i'm going to do is i'll first come in and i'll just go drop it into my documents library i'll just do that right and then the name of the file there's going to be another interesting thing so let's let's for now i'm going to show you that i know that the data that's coming through is an excel spreadsheet it's basically a xlsx so what i could do is i could actually go ahead and just go to my email email grab the subject dot xlsx and that's my file name the file name is the subject that's coming in and xlsx and then the content is basically that body now i can do that if i know 100 sure if that file extension is always going to be an excel spreadsheet if it's not going to be an excel spreadsheet and if it changes then you're going to have to use that split functions again over here extracting the url you're going to have to do some magic to make sure that now you extract that file name over there as well right and there's some tricks to that it's basically the exact same style and if you have some time i'll show you what that is so for now i'm just going to make sure that the file gets created so let's do a quick test let's stop over here and we'll go ahead and now again through the power of magic this new email will come through so let me go back to my new um the flow just to make sure that it runs so we should run i did the magic a new email is just going to come through over here it came through nice email came through it has the link over here now let's go and take a look at our flows i go back over here i click on my flow the third one just ran it seems to have been completely successful which is great let's go back to our document library now it did couple of things first of all in the url i just put in i just selected the document library so it put that right at the root over here now this is one problem that i personally have seen that running on my tenant is that remember in the file name i put in that entire subject dot xlsx some reason that extension.xlsx gets deleted the first time and i'll prove that to you i'm going to come over here click on edit i come back to the file name over here see you know that i just put in xlsx i did it you can rewind back and see that but it disappears so i'm just going to do that xlsx i'm going to save it and this time just as a test i'll just come back over here i'll use an existing one i'll just run that and it's running it went through the http call it goes ahead and grabs the body and everything and then it's now creating the file and once that is successful let's go and take a look it says flow is successful and come back over here and see the second time now it went ahead and captured uh the excel spreadsheet so if i click on it it is so successful that it opens up in the excel spreadsheet i mean on my sharepoint over here and this is just some you know raw data that i have um so that's that's not the point the point was two things first of all is for some reason the first time that dot value always disappears it's happened it's happening to me a lot it may happen to you as well and i wanted to show that to you that if this happens to you just go back into the into your flow and just add that over there all right so i'm going to now go ahead and delete this now what i want to show you is the second and the last option i mean the last option on the flow piece is that they wanted us to go ahead and now save it directly into a folder that's what sue has said she says she manually downloads it and she uploads it uploads it into a folder and her second thing was that she uploads the same copy so if she overwrites the copy when she's updating it if there's an existing one she overwrites it because she only wants the latest version so let's test that because there's going to be a problem and i want you to see what that problem is so i am going to now come back to this create file and we're going to change the location remember the folder path that sue wants is now inside the document library she's going to put it in the 2020. so i come over here and i'm going to find that folder path all right i'm going to go into my shared documents and it's loading and here it is that's the place that she wants so i'm going to save it and now we'll again through the power of magic we will have at email magically show up over there and i'm gonna already make some hypothesis my hypothesis is the four will run the first time second time it's gonna fail all right if you don't believe me watch i'm gonna now do sending it over here i go ahead and send the flow i mean an email is going to magically appear all right the email magically appeared no big deal you've already seen this part over here we come in all right five seconds so it ran i mean it's running let's go in i bet you by the time okay flow ran successfully the create item over here this time actually went into the new folder path so i come in over here and now inside the documents inside 2020 it went ahead and saved it over here perfect if i just just to make confusions you know no confusion i'm going to delete this off again i'm not doing anything wrong all i did was i just deleted the old one which was testing but the last flow that ran the first time it came over here now let's do something else i'm going to make sure that the power of magic as another email comes through and now let's see if my hypothesis works because remember the first hypothesis was it will run successfully my second hypothesis is going to fail the second time so let me do that all right so that was the first email that came through i'm going to keep it this way so you can count that this was the first time now i'm going to go ahead and run another email i mean i need to make sure another email comes through we come over here bam that's the second email all right but now let's go and see what happens came over here failed well first thing is i was right so whoa i was correct but why did it fail and that is because of that create file action so let's go and see what happens in the create file action it comes in over here and it gives you this express the error is simple in fact it's a good header it's one of those errors which actually help you understand not those errors with that big long information which doesn't make any sense this error details actually make sense and it says a file with the name sharepoint documents blah blah blah already exists and that was the reason why it failed so all said and done it was really our fault uh we were trying to replace an existing file and it and it's it's not even power automates fault it's actually it's a process in sharepoint where when you go ahead and update a uh to replace an existing file it comes up and says hey that files already exist updated i already available do you want to go and change that um so when you're doing it on sharepoint when you're updating a file it requires a human intervention over there but through power automate we are trying to make it you know no touch whatsoever no human interventions required so how do we get past this error and the way you get past is actually another beautiful workaround and the beautiful workaround is using um the move file technique so here is how we're going to tweak this process all right what i'm going to do is i'm actually going to leave this once let me delete that so we can go through that two hypothesis all over again so the first thing we're going to do is now when the file comes in that create file i'm going to drop it in this do not delete folder all right so i'm going to make sure in fact when you're doing something when you're playing with this or you want this as a real world scenario name your folder with big caps and make it prominent says do not delete so that people will see it's like uh i don't think i should be touching this folder or if i'm in this folder i don't want to delete anything make it make it that prominent so that's what we're going to do the create file now is going to be in the do not delete but as an additional action we're going to also do move file so let's do that first let me go into my edit over here all right and in my edit i'm going to do the same thing all i need to do is i just need to tweak this folder path location come back over here to the shared documents i come back up didn't do that click on that shared documents inside the shared documents i put it in the do not delete all right right over there so now i'm going to save that as this next i'm going to do is i'm going to use the move file and the new file is part of sharepoint so i click on sharepoint select that over here and then here sometimes i i just see the click on see more and i type in move and i get the move file now the current site address is the same one so let me just go and grab my url uh right over here so ctrl c did that if if we are basically what i'm doing is and for some reason in mind i am not seeing it show up over here in my already existing list so i just click i go down enter customer value a custom value and i paste it now the file identifier very important piece the file identifier is it needs to identify this file path now when you look at it it says okay it needs a file identifier which is kind of similar to file id or item id when i have used that i've been getting errors it basically error says it can't file and find that file what you need to do is use path that's the trick thing is basically the path is the path of the file or folder that's what you need over here all right now the destination um is going to be again the same as this one as that destination so i come back over here i enter custom value for me you might just be able to select one of those actually i now see it so i'm just going to select that and then like a destination folder is same as shared documents and over here i'm going to put it in my 2020 go back select 2020 and here is the fantastic and very important feature available it says if another file is already there pick one of those options available and lo and behold there is one called move with a new file name or even better replace and replace is what we're going to do this functionality is not available in the create file see it's not there but it is there in the move file this is why i've gone ahead and created that temporary folder dropped the file over there or the spreadsheet over there then i'm using the move file and the move file i'm using if another file is already there replace it i know i know it's sometimes somewhat i've shown this to some people and saying what why wasn't this day in the create file it's like i'm telling you if you are a sim person similar to suicide i don't know why that is there but i do know a workaround the workaround is in the move file so all is still good we've got both our thumbs up now let's do some testing now recap when we did the first style with the create file oh my two hypotheses my two hypotheses first time the flow is going to work second time the flow is going to fail now i've added this fix all right this work around so my two hypotheses are it's going to work the first time and it's also going to work the second time so let's test it now all right so i'm going to go ahead and now delete these two tests once from the previous one i'm going to come back to my magic to run these get those magical emails so let me go back over here and i'm going to [Music] come over here click on run flow and the first email is going to come through all right there's the first email so we're coming over here and we should see two seconds perfect actually it's running this one shouldn't fail i just come over here it is still running it's at the last section it created the file and it's going ahead and moving the file so the last section was what took it that extra few extra seconds over there right so it's finishing through it's going ahead and moving the file and it runs successfully so if you have thought this through what's going to happen is i come over here now i've gone back to my sharepoint site i've gone to my document library i come over here and i see that new file see a few seconds ago and if you remember the steps we did in the flow this one should actually be empty and it is empty because remember we didn't do any copy and paste we actually moved it all right so make sure that you put this do not delete because somebody's going to come in over here and say the folder is kind of empty so am i not deleting it don't worry the folder always gets filled for the few extra seconds all right so it's the temporary placeholder all right so first hypothesis it ran successfully very good but in this case my second hypothesis was it's still going to run so let's go and check so i'm going to again through the abracadabra that the background map magic it's words are not coming on mouth i'm going to run another flow all right another email is going to come come through and let me go back to my email and there's the second one that came through see the first one was that six two minutes before second one came through and now the second one is going to be successful as well so it's running this is the first one second one is running let's go in over here probably on the last step of moving the file it's running it's going to finish up the flow ran successfully so i come back over here and my sharepoint site again this one should be empty it is empty but it went ahead and replaced again few seconds ago so we got it to work we were able to overcome this one slight change when the sharepoint's create file you know didn't work over there but it works we had to use a combination of create file action and the move file and we're able to successfully get through this running over there so i want you to kind of sit back and just give you a recap of what all we accomplished thanks to the power of power automate we were able to touch and a using http we were able to go ahead and just get the link of this um i will not be first using the extract from an email body using the extract uh two text and comp and the power of splits with the first and splits with the last we got the url from an email body i don't care how big that email this body is because this combination of split and first and split and last we can get that url we got the url and in this case the url didn't need authentication authentication because everything was in the url we ran the http action http action was able to get me the body of the email which means it just downloads the entire file then i went ahead and uploaded that file to a temporary location in sharepoint and i was able to move that file and it automatically updates that to a sharepoint um existing file in the in the document library now i've used sharepoint over here you could do this somewhere else as well i've just used sharepoint because that was what sue's requirements was over here so do you now realize how much time you have saved for sue just by automating this process so it helped sue i had a fun time making it i went ahead and shared that with you so hopefully it helps for you but as always keep power automating you
Info
Channel: Daniel Christian
Views: 7,082
Rating: 4.9574466 out of 5
Keywords: Update File On SharePoint Using Power Automate, Power Automate HTTP, Power Automate with SharePoint, Trigger flow using incoming email, SharePoint Create action, SharePoint Move action, Power Automate Split function, power automate split expression, power automate, power automate tutorial, update sharepoint list using flow, Daniel Christian MVP, Power Automate split first, Power Automate Split last, Power Automate expressions, Power Automate HTTP Premier
Id: 3Yhx7dAGFAw
Channel Id: undefined
Length: 42min 8sec (2528 seconds)
Published: Mon Sep 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.