How to Attach Multiple Files in Email with Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends welcome back to our YouTube channel DST Tech mirror topic for today video is how to send multiple files as an attachment using power automate in my last video I covered how you can send a file as an attachment using power automate this time I will cover the scenario for multiple files so I'll jump to my power automate flow this is my power automate flow here this is a manual trigger and straight away what I will do let me add an email action send Anil Emil and this is the latest one version two and here I'll add my email ID subject I will keep it as multiple attachments and body I'll keep the same all these are mandatory Fields so I have to enter them otherwise in the interest of time I could have skipped them as well now let's come to the main part attachment over here if you could see attachment name and attachment content but what if we have let's say in this particular scenario this is one folder called sample data there are two files so I wanted to send both the files over an email as an attachment what if there are 20 files I want to send all the files and over here you could see this attachment name and attachment content I can send another attachment and attachment content like this but this I can do if there are fixed number of files if there are Dynamic numbers I cannot you know keep on adding them and then I can add my code over here so how I can do that for that just see there's a small trick over here if you could see this over here switch to input entire AR array so this is for the single file but if you have multiple files we will take those files in the form of an array and then we will input the entire array over here how let's click on this and over here you could see this over here we will enter our array but before that I will show you one more thing Let me switch back for example I'll enter some name over here test name and content is test okay now this is one thing now I will switch to input entire array and you will see this code so what we will do we will create an array variable we will add all the file name and content in that array and we will pass that array over here I will create one array variable and type would be array as we just saw the concept and I will keep the name as attachments now this is done now let's come to the second part as we saw in my last video I have used a section called file properties because I need the file name that I can get only using get file properties which is get file properties get file properties okay site address puc Library name documents and then we have to limit the entries to folder because otherwise it will pick the entire document library that is also fine but I have multiple folders inside my document Library I want it to restrict it to one particular folder sample data so this is also done and now to get the file content we will use another action called get file content and here we have get file content using part get file content in my last video I have used this action because this action wants the exact uh file reference which you want to pass but in our case now there are multiple files so this will not work today I will use this and by the combination of these two videos I have covered both actions so if you have any doubt you can refer my last video so this time I will use get file content and I'll pass the file sorry site collection and then the file identifier which I will get from here I will pass identifier and here I'll get the identifier and automatically this will add a now this is fine see guys so over here what will happen I will uh what I have done I have given this uh folder name in this folder let's say there are two files for now so this action what it will do this will run a loop this will get the first file and then second file content now I have to store this file content in my array variable which I have already declared so here I will add another action called set or a pen to array variable pen to array variable this is my array variable upend to array variable name I have attachment and here I have to enter the value for Value what value I will add I will go over here I will copy this object why I'm not copying the array uh because already this is an array variable so by default internally this uh syntax would be added so I'll paste this now I will remove this test name instead of test name what I will pass I will pass from here file name with extension which I'll get from the first section and from here what I will do I will pass file content so this is the file content so now all the file content and file name would get added in this array variable okay now what I will do over here I will come switch to this mode and I'll get rid of this file name and sample test content I will remove this and now I will move to the switch to input entire array and I will pass my array over here and this should work so this is a small trick over here you should know that we can pass an array over here format of an array we will get uh from this switch to detail input array but this is a button over here from there I'll get the format just pend everything to an AR variable also this time we will use this get file content action and get file property so whenever you are working with attachment on any file these two actions are very crucial get file properties and get file content now let's go ahead and test this it should work RF flow meanwhile I will open the Outlook for me I'll say Outlook and this is guys over here you can see this is successful let's see whether we got an email so 635 this is the latest one and you could see 635 and these two files which are present in my SharePoint are present in the email now so guys this is how you can send multiple attachments over email using power automate now with this we have reached to an end of this video If you like this video please like and share the video and subscribe to the channel to get notification for our upcoming videos we next video much love keep learning thank you
Info
Channel: DS TechMirror
Views: 3,294
Rating: undefined out of 5
Keywords: dstechmirror, microsoft, excel file, power automate, power platform, Power automate excel, attachment, multiple attachments, attachments, power automate send email
Id: Z2cv4nYGO4c
Channel Id: undefined
Length: 6min 49sec (409 seconds)
Published: Wed Dec 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.