Automatically Save Email Attachments to OneDrive with Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi Jonathan silly here with you take another look at working with power automate from Microsoft today we're going to focus on having our email attachments automatically be added to OneDrive every time they come in but we need to make sure that we don't just take every email attachment put it in the same folder what we're going to do is make sure that email attachments from other people with inside of our company or our organization go to one folder while everyone outside of the company go to the other let's Jump Right In [Music] all right so what you can see here is I have an automated cloudflow all set up here and the trigger that I've chosen is when a new email arrives in this case for this trigger we can go in and make some adjustments to the different parts of the trigger itself like when we want to include email attachments of course we do in this case because we want to save those to OneDrive so yes to include those attachments yes to only those with attachments as well because that's going to make sure that we only get the emails that have those attachments on it and if we wanted to we can even add in a subject filter it's a contains operation here that we can add in if we wanted to make sure that we're only getting emails with a specific subject line uh that we have in here okay in this case I'm going to leave that blank but that is definitely something we can do to make sure it's only coming for certain emails that have certain subject strings there the next step we're going to add in here is going to be our check this check or this condition that we add in here is going to make sure that we can see who this is from coming from so in this case our value to choose is the from and instead of is equal to we're going to choose contains and this is where I'm just going to put in pragmatic works because that's going to be part of the email address the domain that we have coming with the email address that we can search for each and every single time instead of searching for an individual or if it contains from one person's name Or Another We're going to do for the entire organization here so now if it contains if this the from line here contains pragmatic Works what I'd like to do is go ahead and create that file in OneDrive so add an action and we're going to go to OneDrive and then we can come here and we can make sure we are choosing OneDrive for business because that's what my company is has here and then we're going to go ahead and choose create file and when I choose create file this is where we are going to choose the path of the folder if I go to my OneDrive here you can see I have two folders that I've created for this purpose one is my customer documents one is my pragmatic Works attachments so that's the one I'm going to use here if that condition is true so I'm going to go point to that path and there we have pragmatic Works attachments as our folder path the file name is going to be the name of the attachments so we're going to go and choose attachments name and the moment we do that you will notice we haven't applied to each that apply to each is occurring because for each attachment we are going to create a an individual file each and every single time so here for the file content we can come and choose attachments content as well and this will let us know that for each attachment we get we're going to create a new file in OneDrive what I'm going to do is rename my apply to each here to make sure that I know exactly what the purpose of this so apply to each email attachments from pragmatic all right and then I'm gonna go ahead and choose create file I'm going to rename this as well I'll say create file in pragmatic Works attachments all right so there it is so now what I'll do for the if no is essentially the exact same step here but just on the if no side all right so we can come choose our add an action and we're going to create file in OneDrive okay there it is OneDrive for business and we'll go ahead and choose our path again I'm going to go choose my other folder here for my path the file name attachment's name there's our apply to each once again file content attachments content and now after we rename this as I come in here just go ahead and rename this create file for customers and then apply to each I'll rename this and we're going to say apply to each email attachments from outside customers okay and there it is that's the flow that's how easy it can be to go ahead and set this up so you have the two sides of the flow from here to be able to go ahead and point to those two locations depending upon if they're inside of the organization or not so I'm going to go ahead and save and test this to see how it works both ways select test we'll do a manual test and run it from here the first test I will do will be from myself so I'll send it to myself it has my own email string in there so I'm going to go ahead and send it to myself here and I'll do this test one from inside organization and then I'll go ahead and add an attachment and hit send alright so there we go the flow has successfully run let's take a look at our condition it has rung true in this case because it did contain pragmatic works as far as the email is concerned the from here and you can see if we go in we could take a look we have making sure all those different parts of the email have rung through as well and there it is that means if I go to our path here for pragmatic Works attachments I should be able to see that document in here and there it is there is a document I've just sent now we can test it on the other one and see if it works the other way by sending another email I'll do another test here rather just running it I'll do another manual test and go from there this time I'm going to send this from a different account which is outside of our tenants I'll go ahead and send it to myself and I'll do test from outside customer and add an attachment all right there it is our attachments there and I'm going to hit send and we should see this go down our other path and this second test has also run successfully let's take a look there it is it is false because it does not contain pragmatic works in the from that means we've added it into our other folder path here for customer documents I'm going to go take a look here take a look at that there it is there's our second one so we now have the ability to set up a flow that runs automatically each time so every time I get an email we're going to automatically decide using power automate where to store those email attachments thanks again for joining me here in YouTube taking a look at how we can utilize power automate from Microsoft to make our everyday tasks just a little bit easier go ahead and drop a like and hit that subscribe button below to get more content from myself and all this here at pragmatic works foreign [Music]
Info
Channel: Pragmatic Works
Views: 9,758
Rating: undefined out of 5
Keywords: tutorials, how to, power automate, powerautomate, microsoft flow, flow, microsoft flo, microsoft flow tutorial, save attachments, control, flow based on condition, save attachments to sharepoint, save files to onedrive, powerapps tutorial, power platform, power automate microsoft, microsoft 365, office 365, office 365 email, Jonathon Silva, Pragmatic Works, learn, teach
Id: XvZ6SF4sXus
Channel Id: undefined
Length: 7min 58sec (478 seconds)
Published: Tue Jun 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.