Outlook Emails in Microsoft Power Automate - Beginners Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
whenever I received an email with an attachment and want to save that attachment into a OneDrive folder I could use OneDrive for this or SharePoint or Dropbox but it needs to be a cloud place in other way power automate won't be able to grab this file so what I want to do is to go to my OneDrive here I created a folder called live I can make a subfolder more I'll just say Outlook emails so here I want to save the attachments too you should do the same then you go to Power automate I'll click create since we want a trigger-based flow that is because whenever we received an email then we want this flow to run actually we want to check if it has an attachment if yes we want to proceed so we can give our flow a name I will call mine Outlook receive email and here I'll choose a trigger this will be when a new email arrives and here I can choose between a Office 365 Outlook or an outlook.com activity it's most likely that you have the Office 365 that is a business account but if you for example uses a private email you'll choose this and then there will be no difference it's also worth mentoring whenever this activity gets updated it will give a higher version number that is what what this v stands for so when this activity will get updated it will be called V4 so click it and then click create this is our trigger and whenever a new email arrives in our inbox we want to do something but let me just add to our three parameters to it because I want to only have this flow to run Whenever I send myself an email so I'll add my own email address up here and that is to restrict the solution so I don't start saving all the attachments from everyone when I receive them I can find when I move this into production delete this and have this feel blank then it will work on all incoming emails I also want to say I only want to look at the emails with attachments and that is because this flow will save the attachments so it makes no sense to look at the non-attachment emails I also want to include the attachments because I'm going to use that later in the flow so with our trigger configured we can start adding new steps so find the new steps and then you'll find and apply to each take that one and apply to each iterate to a collection and this is important because one email can have more attachments we know it have one because we specified that in the filter but it could have two or three attachments tied to it that's why we're using the pi to each here I'll specify the output from up here that is the attachments to the files from up here so scroll a little bit down you will see some attachments here but what you're going to do to need is the attachments and then the file attachments for the message take that one with that in place we can now start creating the file in the OneDrive folder that we created so choose add an action and here you will find a create and let me just specify it further create file if you want to share it in SharePoint you can just save it here but we want OneDrive for business so we'll pick that one the folder path that is where we want to save it to and we created that one so I click this folder I click this Arrow then I move a little bit down this is live click the arrow the Outlook email status where I want to send save it to so I just click here then we also want a file name and we will just stick with the actual attachment name so I go down here and then I'll find an attachment name pick that one here we also want the file content and that is the attachment content and here you can see Power automate is really clever it just suggests suggests this to us automatically we can find all the other ones here by clicking cmall but we will use this so now we created a file I also want to mark this email as read and completed so make sure you are outside the apply to ease because we only want to do it once we don't want to do it inside the supply tweets and what you can do is just click here it will collapse this and it's easy to see that we're outside now then I want to find an a mark as red or unread um Office 365 here the message ID that is the ID that we get from up here so I'll just click in here and then I'll scroll a little bit down and find the message ID here if it's shared inbox you want to specify the email address of that shared inbox here but ours is just my personal then I want to mark it as red and yes it's red and no is um on red so I also want to mark it as completed so I click new step then I'll find a flag email and again I'll use the message ID here and I want to mark it as completed like this so with that in place we can see if this works so I click save and the flow is actually ready the flow it will run so let me just do this I'll create a new email and an attachment to use so at my desktop I just choose right right click new Microsoft Excel worksheet so an empty Excel book then I'll click new email I'll send an email to myself because I specified that in the trigger then I'll add this attachment here and I will click Send we don't have a subject that is fine we don't need it this flow will run now you can see that we received the email then we can we can inspect the flow here and here in the 28 day run history when I refresh this a couple of times you will see that the email will show up eventually it might take 30 seconds or something there you go it took two seconds and the flow succeeded let's go inspect the email inbox here you can see the email is now red and we can see this completed one up here so that one succeeded you can of course move this email to sub Solus if you want to be a little bit more advanced I will leave that to you otherwise just ask me in the comments on how to do that we also want to see if the actual email attachment has been saved saved here it is but this has a little bit of a drawback because this will just save the email attachments and if they have the same name we will have a problem so what we'll usually do is to add Dynamic file names instead of this actual file name this makes it a little bit easier so what I want to do here is that I want to go to manage your flows click edit again and I'll use the Q date and time to actually add that to the create file the file name here so up here right after the trigger choose add an action here you will find a June date and time what this does is just take the current time and actually also the date and create an output it will be in a date time format so we need to format it a bit so it matches our time zone so go down here add an action and here you will find a convert time zone and I just need to specify it a little bit further here it is so the base time what do I want to convert well that is the output from up here so if I click here that'll be the current time I also want to say in what format is this current time in and that is the time zone it is and it's always in the UTC when it comes from Power automate so I'll specify UTC here then I want to say in what time zone do I need to convert it to this will be my local one so that will be plus one bristles copenhaging Madrid Paris um I'll leave a little bit outside coping so I'll use this one I'll also need a format here we can see that we have some predefined formats those ones are not very useful for dynamic file naming we could use the sortable data and time pattern but I prefer to create my own this is also a good exercise so enter custom value I can just specified here here I want to hear I want the month the days the hours in 25 24 hour format that makes it easier sortable than minutes and seconds this will be a dynamic format so unless we receive the emails in at the second then we can now create file names that will be unique if you want to know more about this date time format a custom string here this is you can just google.net custom date time format this will take you to the entire template I recommend that you practice this with me because this is important so what I will do here is that this will produce an output in this format here I just go to the apply to each the create file and down here in file name I just moved to the start then in the dynamic content I'll choose the converted time like this and I'll move in here and add an underscore so now I have a unique file name for all the files that I created so I don't overwrite anything let us I just save it we can send another email to ourself so if I go here choose new email that's my email I'll add this one here and I'll click Send without a um subject so the email has been received now it will just take a few seconds and then we will also have a second run with a better naming I'll click refresh a couple of times here and suddenly it will show up and it will be succeeded so and again this could take anywhere between 20 and 40 seconds in the meanwhile you can see it runs now in the meanwhile if you have any input to what you want to see in these lessons you can just let me know in the video comments now it ran oh actually if I just click refresh you'll see it succeeds so first of all we can see here it has now been read and it has been completed then if I move in here and then we just refresh it you will see that we now have a dynamic file name that means that we create separate files for each one of these we don't override anything that is very clever in case you missed this Dynamic file name please rewind the video and retake it this is an so important concept that you need to understand it with that said let's see how we can actually send emails as well and not only emails but Dynamic emails so go to the course page and click download the Excel book this will take me take you to my OneDrive here I will click download and I'll move it outside here actually we're going to use it needed in a OneDrive but first let me just open it and show you the data so this is the dynamic email we want to send for each one of these rows I want to send an email and here this one it should be to add you can see that they all have the same email that is because that is um instead of just sending out to four random emails we will just use that but you can add your own separate email here and of course you can have a thousands then they each one of them needs to do separate kind of homeworks and they eat each one of them has a deadline so let's solve that in power domain first of all the email I use the 10 minute email and here it's just a temporary email that will uh run for 10 minutes you can just click here and get 10 more minutes and this is our temporary email I can copy it here then I can just go here I can control V Ctrl V Ctrl V Ctrl V or drag it down so these are the updated emails remember that you can add your own if you rather run them to them to be sent to yourself make sure you saved I can close it now we need to upload this Excel book into a OneDrive place this is my live folder I had the Outlook emails let's add another folder here I can just say send Dynamic emails and we will upload this Excel book to the send Dynamic emails this is again because power automate needs a place where it can grab it it needs to be in the cloud so SharePoint OneDrive or Dropbox we have it here now we are ready to create the flow in power automate so click create we only want this flow to run whenever we triggered but it could find find run every morning and send out these emails so choose an instant Cloud flow here we will say Outlook send Dynamic emails and our flow will be manually triggered as mentioned so now we are ready I want to get first of all I want to get whatever data that is in my Excel book and I'll find a list rows present in the table here it is so the location that will be in OneDrive for business the document library that will be OneDrive then I'll find the file and I placed mine in the Run Drive roof folder the live send Dynamic emails and here we have the file it's important that the data is formatted as a table so click this drop down and find the table that I created for you if you use your own data again it's important that you formatted these data as a table so now I have these rows in Excel let's try to save it and just see what we actually created so far so if I click test manually test I'll click continue and run it then you will see that I click here go to outputs and this is a Json a Json is a way to send data it's a very efficient one here you can see that we have Becky Carly Dora and if you look a little bit up you will find n as well so these are the data that we're working with we grab them correctly I'll click edit again now we will iterate through each one of these rows and again if we want to iterate to something I'll find and apply to each I'll choose an output and this is this Excel sheet from up here choose the value now I want to do something so for each one of these rows I will send an email so add an action and here I'll find send an email choose the one under Office 365 Outlook if that's what you are using so that's one that's what I um am using here I can send a the email to an email address so click add Dynamic content and here power automate is very clever it says I think you're going to use whatever is in the email column and I can show you see more I could also add whatever is in the homework deadline and so forth but it guessed correctly we will use the email I also want this object and here I can say remember to do Europe and then I want the dynamic content that is the homework from DXL then I can just say homework no later than then let's just keep it here because we will have it down here as well this was this object and here I will say hey I'll have the name and now I'll just remember to do you up and then we'll just repeat what we actually did here home work no later than and then we will have the deadline this one varies for student to student and I can say kind regards or I can add a signature and this is my signature across all Medias so this is what I'm going to use so now I can click save and this flow can run just by testing it because it's a manually triggered flow so I can just add a wrench from here or outside the flows so now we are applying it to each one of the rows we are sending out an email your flow range successfully we can go to our 10 minute email and here you can see that we the first two emails shows up now we have the force so here we have a Dynamics object and I'm just getting 10 more minutes but here we have the dynamic one and if I open one of them you can see that hey picky remember to do your power automate desktop homework no later than and then a date and here comes the tricky part when we work with dates in power automate when we take them from Excel they are stored as a five digit format let me show you how to solve this because this is another important concept and here um I want to do a little expression so I go back to my flow and click edit instead of this deadline this is taken directly from the Excel we just need to do a little thing I want to make an expression so I delete this deadline and then I go down here click expression now we will do something what we want to do this five digit format is actually days after the 13th of December 1899 so we will just add the five digit format to those States and get the result out in the format that we want here I want a add days and then I want to say what time stamp do I want at those two and this is just a fixed format this is what you always need to write like like this then we also want to say we have this five digit format and here I will say you can even see it up here in the actual help that I want to say that is up here I want to say how many days do I want to add to this date and this is our five digit format I need to convert it to an integer it looks like an integer but because it comes from Excel it is an object so what I will say is that I'll say it and then another parenthesis here I will say I want to go into the items applied to it and then I want a deadline so that is just the column from before so what I can do here and let us just practice writing these actual ones here so I'll say items and then I will have an apply underscore to each like this and I want to move one out and here I want to say I move down to the deadline column again this can seem a little bit difficult but it's very very powerful and you need to learn that as a power automate developer so here I want to say deadline now we are inside the deadline column and that's it what I always recommend is to control a control C this expression because sometimes it says that it's invalid it's not and sometimes they disappear just inspect that we have it here we have the actual add days then we have the date we have the integer with the deadline on now we can save it and let's try to run the flow again this will just give us four new emails and then we can talk about what we can do if we want to customize it further now it will run it will probably take a few seconds again my flow ran successfully and now we have it here so the four latest that has to be this one here now we have a date that we can use this is the 20 2023.0602 but we can't really use that we want to go deeper in and that is because we want to go we want to make it a format that we can use ourselves so if I click edit here and then I go up here and let me just go into the expression and let me just have this one actually opening and for some reason I really this happens sometimes so what we do here and I can't really open it here so what we will do is just to rewrite it we want it in a format that we can use ourselves so this is a nice way to actually practice this and I hope you do it with me so I'll say ATT days and this is what happens as power automate developers sometimes it doesn't behave so this gives us a nice reason to practice it again I'll write it a bit faster so again I'll say items and then I want the apply to each I really hope you do this with me in that way you will learn the most so here I will have the and I need single brackets here and this is what we face that we on the Fly needs to fix something it's uh that is what we want to do so now I also want to say I want to specify the format and here I just want a format with the days and then I want months like this and I want to have this one here and I wonder yeah again we'll need to have it in a single um quotation mark I can save it and we can test run it again we just test it and we will send four new emails and they will be in the format that we wanted in case these ones can be a little this expression can be a little hard let me know in the comments I'll gladly help you understanding these or writing your what you want so now I have four new emails let me just pick this one here there you go we now have it in a nice format Wednesday May the third 2023 this is the deadline and you can customize this exactly like we want it's just two a Google search for.net custom date time format that's it the next lesson is right here you'll need to learn that to be an advanced power to make developer
Info
Channel: Anders Jensen
Views: 15,643
Rating: undefined out of 5
Keywords: power automate, anders jensen, microsoft power automate, power automate outlook, power automate outlook attachment, power automate outlook attachment to onedrive, power automate save attachment, power automate save attachment to onedrive, power automate save attachment to folder, power automate save attachment from email, power automate send email, power automate send email from list, how to send emails from power automate, how to send email from power automate
Id: de6us7ssF5w
Channel Id: undefined
Length: 24min 8sec (1448 seconds)
Published: Thu Nov 10 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.