How to Trigger a POWER AUTOMATE flow from EXCEL | For a selected row

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone Resa here automating tasks in Excel just got a lot easier thanks to the automate tab in Excel I will show you how to build an automation to send an email for selected records within the Excel file and also include related attachments in the email for the Excel data let's check it out in [Music] action the new automate work button in Excel powered by power automate has made it easier than ever to automate tasks and run processes efficiently this feature extends the capabilities of power automate by providing access to pre-built templates we can directly select the template click create I can look at the flow details turn it on or off delete it or simply edit it in power automator let's go and create our own custom workflow my Excel file has a table that has order details includes the customer name their email address order number status and other metadata I would like to select a specific Row in the Excel file and trigger an automation job and it can go and frame an email based upon the details for that selected customer order to do that right here within Excel if I scroll down to the bottom we have C all templates this will list out all the Excel based templates that are provided for us one of the templates is for a selected Row in Excel go and complete a custom action I'll select this it adds the connection to excel online for business I'll click continue and this will bring me straight into the flow designer experience the Trigger action for Excel which is for a selected row my Excel file in M365 I've stored it in one drive so I'll select the location as one drive for business document library is one drive and file I'll go to show picker my file is stored in a folder called work orders so I'll go and look at the contents of this folder in one drive and this is my Excel file called order details in this Excel file I have a table called order data that's this table of data when this flow triggers I would like to go ahead and send an email so I'll add a new action called send an email I'll use the Office 365 Outlook connector who do you want to send this email to I'll switch to advanced mode the for a selected row Trigger action gives me Dynamic content in my scenario I want to send the email out to the customer and their email address is in this column called email so here I'll straight out pick that column called email subject contoso order summary here is order number so I'll select it and now I can draft my email I'll say hello I'll pick customer name thank you for your order I'll put the order number then I'll give out the order details the email body allows Rich formatting I'll indendent this I'll specify the item quantity purchased estimated delivery date and order status my tracking number I want to give a link for the user to track this number on the UPS website I'll go to code View add an anchor tag plain simple HTML the text I will put the tracking number HF I'll put the URL to the website where they can track it and tracking number is one of the query parameters that this website accepts this I will say is equal to the dynamic content tracking number now once the email is sent if I want to update that re record in the Excel file I have another column in my table called email sent all I have to do is go and update this column value I'll add another step after sending an email this will be update a row Excel online business once again connect to my Excel file so I picked my Excel table key column what's the unique identifier in this Excel Row in my case it's the order number so the key I'll pick order number and the value I'll select the order number coming from the selected row trigger and all I want to update here is that email sent has set its value to yes my flow I can give it a name I'll call it send email to customer and I'll save the flow my flow is saved if I go back to my Excel file go to automate automate work any power automate workflow that is related to this Excel file will list out right here here is my send email to customer now in order for me to trigger this I have to have the context of a row selected so for example I select the record for Sarah my flow is send an email to customer I select three ellipses and run it's the first time I'm running the flow so it's going to authenticate using my credentials for the different actions that the flow uses I'll say continue and run the flow it says your flow ran successfully I'll click done email sent for this record is changed to yes Sarah receives the email Koso order summary for the order number hello Sarah thank you for your order these are the order details and here is the link to track that order on the UPS website now to make modifications to that flow I can go to the automate work tab this will list out all the connected flows I'll go to the three ellipses for the send email to customer flow and say edit in power automate the email that goes out I would also like to CC the email to the user who is triggering this flow so for the send an email action I'll go to show Advanced options for cc I'll switch to advanced mode and from Dynamic content alpic user email property that's the the email address of the user who triggered the flow I'll click save if I head back to my Excel file this time I'll pick a different record you don't have to select the entire row even if you select a specific cell of that row and then head over and run the flow it will understand the context of that specific row I'll click run this goes ahead and triggers the flow you can see how email sent has updated to yes the email has gone out this time with my name and CC you can also select multiple rows go to automate work select the flow and run it three different emails went out in this case for the Trigger action add an input and this input can be of various types I'll put text I'll call it notes and for send an email from Dynamic content I'll plug in the notes I'll save the flow flow is saved let's select a record run the flow it will ask me for the notes I'll plug in my notes and run the flow the email that goes out now includes the note for each of the customer order details that I'm maintaining in this Excel file I also have related documents that I maintaining in a SharePoint document library in this Library I have a column called order number and for each file that I've uploaded I have the order number defined so let's take an example of order number 90123 if I filter the data based on this order number notice there are two files related to this specific order so when my flow is triggered I would also like to send those related files for that specific order as email attachments back to editing my flow before the send an email action I'll add an action called get files properties only from SharePoint I'll connect to my SharePoint site connect to my documents Library go to show Advanced options here I'll add a filter query order number equal to from Dynamic content I'll pick order number now I need to go and get the content of each of these files because I want to send it as an attachment to my email to do that I'll add an action apply to each to Loop through all the files that I have obtained from the get files action so I'll pick the dynamic content value and within the loop I'll use the action get file content from SharePoint pick my SharePoint site file identifier Dynamic content get files properties has the identifier I'll select this I'll want to send as an attachment so I'll go to show Advanced options attachments expects two properties attachment name and attachment content for attachment name I'll just say sample name and attachment content I'll say sample content I'll switch to input entire array so it expects an array of attachments where I have an object that has a property called name should include the attachment name and extension content bytes will be the actual content of the file so what I will do before apply to each I'll first initialize a variable I'll call this ver attachments variable of type array in the apply to each loop after I get the file content I will use the append to array variable action because for each of the files I want to append data to that variable called V attachments and the value will be in the following format name and content bytes for name I will use Dynamic content file name with extension coming from the get files action and content bytes will be file content coming from get file content action and now all I have to do is forther send an email action the attachments will be the dynamic content V attachments I'll go ahead and save my flow let's pick the order for James run click continue and run the flow here is the email notice here there is an attachment if I look at my SharePoint document Library invoice 4672 is related to order number 421 that's the order number for James let's try the one for Sarah this one has two attachments here is the email for Sarah with those two attachments if you enjoyed this video then do like comment and subscribe to my YouTube channel and thank you so much for watching
Info
Channel: Reza Dorrani
Views: 14,400
Rating: undefined out of 5
Keywords: microsoft excel, how to, mail merge, send email from excel, excel mail merge, power automate, excel email automation, how to mail merge, how to send email from excel, reza dorrani, excel, tutorial, how to mail merge with attachments, mail merge with attachment, excel power automate, power automate excel tutorial, excel tips and tricks, trigger power automate from excel, trigger flow from excel, excel selected row, for a selected row, how to trigger flow from excel selected row
Id: JCvuixuu1Yo
Channel Id: undefined
Length: 14min 27sec (867 seconds)
Published: Mon Feb 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.