 How can I run a flow across existing emails rather than new ones coming in? I want to do a clear up of some old email attachments but I can't get it to run across existing emails. Stay tuned and I'll show you how you can do this in just one simple click. Hello everyone and welcome back to another video. So in today's video we'll be showing you how you can use Power Automate to loop through all of your existing emails and capture and save all attachments within those emails. So in order to do this we're going to be using Power Automate for desktop. So you may have previously been using the cloud version of Power Automate. Unfortunately it doesn't have the functionality in there at the time of recording that we need hence why we're going to be using the desktop version. If you haven't got that application already installed on your machine all you simply need to do is go to the Microsoft Store search for Power Automate and as you can see on my screen now where I have the button to open the application you'll have the option to download. So all you need to do download the application sign in and then you'll be able to continue on with all the steps in this video. So let's just close the store and in the background you can see I've simply just created a new flow titled tidy emails and this is really simple and I did put the start of the video that you can do this with only one click actually there's two clicks you need to do or maybe three just to pull in the required steps into your flow but ultimately it will be one click of this run button when we're finished. So the first thing we need to do and it's worth mentioning we're going to be looking at doing this on the Outlook mailbox so the first thing we need to do is launch Outlook so I'm simply going to drag that into the middle here and no information is really required here apart from confirming we're happy to store this variable as Outlook instance which looks logical to me so we'll simply click save and you can see we now have step one of our process done. The next thing we need to do is to retrieve all of our emails from Outlook so second in the list nice and easy here all we're going to do is click and drag retrieve email messages and you can see we've got on the side there and it's going to be looking at Outlook instance which is the variable we produced in step number one. The first thing we need to do is provide what account do we want to look for emails so all you need to do is add your desired email address as I have done so here for account in mail folder all we need to do now is provide the folder within this account that you wish to look for emails so for me I'm going to simply do this in inbox but for you of course you can do this for any mail folder that you require secondly in terms of retrieve so we have a few options here we can either look at all messages within the folder only those that are unread or only those that are read so depending on the criteria you have you can slick one of those options but for me I'm going to stick with all email messages next we have mark as read so if I open up my outlook you can see these are the four emails that I currently have in there so you can see each email has got an attachment but of course you might be working with emails spanning a lot longer duration than I am of which they may be read or unread so what we want to do is as our flow goes through all these emails I want to mark each one as read as it iterates through and that's all that this is doing so if you leave it marked by default as ticked on then it will obviously mark all of your emails as read however if you untick this it will just leave them as unread so hopefully that's make sense and it's no it really isn't complicated at all it's just down to preference on how you like the emails marked after this flow has run the next four fields give us the ability to filter those emails so you could only do it for emails which contain are from a certain person they were to a certain person or subject or body so when you come down to building this flow you may wish to like add some like say filter criteria if you're looking for specific emails or specific attachments but for me I'm just going to I literally just want to capture all attachments that are stored within the inbox so that brings me to the last field which is attachments and you can see by default it says do not save attachments so all I'm going to do in here is change this to save attachments and then we can obviously provide a save attachments into a particular folder so I already have a folder set up so all we need to do is go into the folder and I need just need to navigate to my desired location which is going to be email attachments so we'll select okay and having done that there's we've got okay a variables produced obviously it's good to know our retrieved emails but this is all we need to enter so we'll click on save and then lastly you could of course add the close outward close outward option to the end here like I'm doing here but all that will simply do is just close outlook um so yeah we'll add that in there just to round it off so we've got that there so let's just double check what we've got so first of all we're going to be launching outlook secondly we're going to retrieve all email messages from outlook and we can oh we know from within this we're going to save the attachments and then lastly we're going to then close outlook as well to finish off so let's just do one more check of what we've got so this is the email inbox we can see we've got four attachments and then lastly we can see if we look at our folder we currently got an empty folder location of email attachments that contains no attachments so what we'll do we'll go back into power automate and we'll simply run this flow and see what happens so we can see that uh yep we can see we're now gone through step one step two step three uh hopefully you can see that on the screen and what it should do yep we can see its status is now ready so it's indicated to us it is now finished so what we'll do is navigate back into our email it's going to emails for almost outlook has been closed but if we go into our folder we can see that we've now got our four desired attachments so one thing to notice here what's obviously worth mentioning is that we currently have an attachment which is named the same so you can see we've got example one which is in here twice so this is just one thing to remember if you have attachments that are titled the same then they are obviously going to be uh obviously replicated simple but luckily power automate knows how to deal with this and it gives it the second icon in there and if we just go into outlook here now into inbox we can see that all four of those emails have now been marked as red just tying back to obviously that option we selected to obviously mark as red once the uh the email had uh or the attachment had been saved so i hope you enjoyed that video if you did please don't forget to give it a like it's not only greatly appreciated by me but does help out all important youtube algorithm as with this video it was a question from one of our viewers so if you have a question about this video or there's a video that you would like to see in the future just drop us a comment below and i will get back to you as soon as i can and hopefully we can turn your question into a video as well if it's your first time watching one of our videos and you've or you've watched them in the past and you're still yet to subscribe please can ask you to hit that subscribe button and also don't forget to hit that bell notification button that way you'll be notified of all our videos as they come out in the future so thank you very much again for watching and we'll see you in the next video