Such a crisp explanation!! Thank you sir! Working on a transit customer experience initiative that requires adding attachments for issues reported by riders. The slight difference was that you used the "get file" properties, while I did get attachment content (on a sharepoint list vs in a folder), but same thought process. Really appreciate your time!
After watching three of your videos (and admittedly a several hours of cursing over my typos), I am able to replace an outdated BI tool with full email automation! You are magic. Each 15-minute video took about 45 minutes to reproduce without errors. I didn't even know what Power Automat was at the start of the week. You have saved me days if not weeks of struggle. Cheers!
That is absolutely amazing stuff. Delighted to have helped you on your way 👍 brilliant to hear about what you have achieved so quickly. Thank you Patrick.
Bingo this was the flow I have been looking for all over the internet. You know what this video was in my watch later list since Aug'2021 and today I am thinking why didn't I view it last year. Better late then never. A huge thanks from side. This could have been titled as Mail Merge with dynamic attachments. Since I tried to find this flow as mail merge(just a thought).
Damien! thank you. Incredible video. I apply it against a database list coming from an Excel File saved in SharePoint. No issue, same concept, different filtering source for the email loop.
What a fantastic help this video is, thank you so much Damien, I don't have any files in Sharepoint but I'm hoping it might work on my OneDrive with a little bit of playing around! Wish me luck!
I was trying to do the multiple attachments but sending from OneDrive instead of sharepoint and even tough it creates the files all of them show up broken and they seem correct. Any idea what I am doing wrong?
Hello Damien, I was trying to figure out almost the same flow but with some differences. My flow starts with a PowerApps(V2) trigger, since it will be a button in Power Apps that will trigger the flow. I have an attachment control taken from any SharePoint list available in your databases. It’s an array of files that is dynamically added by the user of the app. What I’m trying to figure out is how to get that array of files, let’s say the user adds 3 files to the attachment control, and send them by e-mail as attachments. Would it be similar to this demo? Even if the files will probably be from either OneDrive or SharePoint. Thanks!
Thank you so much for this! You mention that there is a way to filter your files if you're running into issues appending them to the attachment array - do you have a link or video for that by any chance??
Damien, me again :) Thank you so much for your help and the content you are sharing! Like many users here, I was looking for this particular solution. In my case, I want to include an HTML Table per user (previously created), where or how do you recommend to approach this issue? I built a flow to create an HTML Per user, considering an Excel Table with duplicates rows per user, but I want to include an Attaachment in the send an email action according to that user. I built your flow as well and it works, but I wonder how can I integrate both? Thanks for your comments
Thank you so much Damien, this is really neat! I tested your flow and it works in sending multiple attachments in PDF format. However can these attachments be embedded in a table in Outlook? When I send out these attachments in MS Outlook, each PDF file is embedded in a 2 column table to make it more presentable. So if there are 10 PDF files to be send out daily, the table will have 10 rows in a 2 column table , where 1st column is name of the report and 2nd column is the corresponding PDF file attachment. The videos for creating HTML tables doesn't really show embedding attachments. Would really appreciate any guidance you can give here. Thank you so much!
Sounds like an interesting challenge. I don’t know how to do that but understand your requirement. I can’t promise when but I will add this to a backlog of ideas. Ideally you want to see what the html of an email in outlook looks like.
Such a great solution - I was surprised that I had to go through at least a handful of useless videoes (suggesting different bad solutions) on this topic before finding this. So glad you did this video - thank you! Subscribing from now on :)
Thank you so much! Been trying to work with the usual Append to an array method, but emails would always arrive without the attachments. I don't know why nobody else is sharing this method on the power apps community forum.
I personally tend to avoid variables and try to make my flows as simple as possible but I guess each to their own ideas, if it works, it works. Api calls are limited on the platform, and will be enforced from 2023, so efficient flows are something to be aware of when building a solution of your account is running multiple flows in a 24 hour period.
Great video, I really appreciate it. It’s been incredibly useful. I’m wondering though, do you have any insight on how to arrange a mail merge that functions as a follow-up to previously sent emails from an earlier mail merge?
Just the job. Thanks! Took me a while to work out why only first 100 attachments were being added though... Had to up the limit in the get file properties connector options.
Thank you very much for the video, I have one issue if you could help me will be greater, I did everything as you mentioned but when the email was sent, I receive it without attachments what do you think could be the issue please, I even downloaded your solution and imported to my Environments the same issue send email without attachements, unfortunately, I'm not able to send screenshots here. is there is way to show the output of the Attachment array?
@@DamoBird365 I have created a select array action to see the list of the file but I found that when I put the folder name in the Limit Entries to Folder I don't get the file list, but when I remove the folder name from the Limit Entries to folder ) and just select the Library name I get the file name in the document library! this is the screenshot of the flow: powerusers.microsoft.com/t5/image/serverpage/image-id/548753i64C436010D43EF62/is-moderation-mode/true/image-dimensions/2500?v=v2&px=-1
This is great! Thank you so much! I got this to work perfectly using excel instead of SharePoint once I made my table with unique rows. In the body of the email, I wanted to include a list of the attachment Names. I made several attempts, but failed miserably. Is this possible, if so how?
Hi, Great video, very easy to follow along with. I was wondering if you had any video's on how to do the same thing with files on OneDrive instead of SharePoint. I'm pretty new to Power Automate/Flow and can't seem to find anything really helpful when it comes to OneDrive Multiple files. Would really appreciate any guidance on the subject. Thanks.
Hi Bryan, glad this has been partly useful. I don’t have one for OneDrive but I could consider it. What’s the use case? Meanwhile you could try the forum powerusers.microsoft.com/
@@DamoBird365 So I'm basically trying to achieve exactly what you have demonstrated within your video but instead of getting the files from share point I want to get the files from a OneDrive folder instead. I will only be sending to one email address which I would just hard code them in the Send Email step. I have Googled and have gone through the power users group from that link but it all seems to be focused on files from SharePoint. I guess as a solution I could use power automate to move the OneDrive files to a SharePoint folder and then follow your fantastic instructions but would have thought that there would be a way from OneDrive directly.
@@DamoBird365 had no luck getting the OneDrive files to attach correctly, so decided to just save the to a SharePoint location instead and then gone ahead and followed your instructions in this video. Works perfectly. Thank you sooooo much.
Do you mean save attachments to different folders? Based on a sender or file name? Yes it would be possible. I’ve done something similar here ua-cam.com/video/Xv21IxI6n3U/v-deo.html
@@DamoBird365 Thanks for your quick. however, rather than uploading files what im trying to do is to attach a file to an email, but the files are in multiple subfolders (as opposed to in one single folder in sharepoint). can it be done?
Hi, thanks much for the demo. A quick question, my flow keeps failed in last email out step-- Error msg shown "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'.clientRequestId: 993e854a-c68b-417a-a36f-783a8d4b3601" ... Any way to fix that? Thanks again
thank you! very clear, but in my case the file attached are not usable because they are reported as corrupted. any hint how to solve? they are 3 excel without macros, in a sharepoint folder exactly as your example. thank you!
have you included the extension and I think you need to exclude the " " from content bytes, but my mind escapes me just now. These would be the two things I would check.
I have a flow that gets images from a OneDrive folder via their ID and adds them to an array variable. I then want to send an email with that array attached using the SMTP (Send Email v3) connector, but it always errors and the email never gets sent. Can you possibly make a video on how to do this? I get this error: 'SendEmailV3' is missing required property 'emailMessage/Attachments/0/ContentData' Thank you so much!!
@@DamoBird365 Because I need the flow to send out from an email address that is a distribution list. With the Outlook connector that doesn't seem possible.
hi got this to work which is great...but is there anyway of filtering the documents to be attached to email by a field value in sharepoint list? ie say if i have column1 , column2, column 3 etc set as yes /no fields in list. If column1 = Yes then include document 1, if column2 = Yes then include document 2 etc. So documents from library would be filtered and added to email on these columns being yes? thanks
I was going to say Two options, you can filter via advanced options, column1 eq ‘yes’ or column2 eq ‘yes etc or you can use filter array but if I’ve understood you, you’ve got a column per document? I think this could still be done via a filter array, with a dynamic column name but would have to try it. If you want to send me a sample ideas@damobird365.com.
@@DamoBird365 I have the same situation Mark had, and I'm not sure I quite follow your reply. In my case, I have 3 document files that I'd like sent to the list item creator depending on the yes/no conditions they specified in their list form submission. So if they specify on the SP list they need form 1 and form 3 (a yes/no column for each of the forms), an email sends with form 1 and form 3 only. To do that, which "advanced options" filter were you referring to above?
Thanks alot! I've built as per your video but when the flow runs, it sends me the same number of emails as there are attachments. I.e. if there are 4 attachments, it emails me 4 times. The emails all have the 4 attachments in them. Any ideas? When i've looked at the run history, there are 4 instances of the 'apply to each' so is it looping? If so how do i stop it? Thanks
The apply to each should run 4 times if there are 4 attachments but then outside of the loop, you should send the email. Sounds like you have an apply to a each for sending the email too, which is unexpected.
@@DamoBird365 Thanks, i figured it out. I was using the 'when a file is created' step but didn't think (don't know why) that it'd run each time i moved a file over so it was running it four times. I've changed it do run on a daily recurrence and has resolved my problem. Great video though!
Thanks Damien.. I was using Array to append the File content. Which was working for small files but when I use large files it show the Array size issue. Array can't hold beyond certain limit ( I think 100mb). After using Compose it work perfect.
Hi, great video thank you, I have a senario that im working through at the moment which I hope you can lend a hand with I have a MS form which allows for attachments The form splits depending into sections depending on the user choosing a subject matter area. Power automate uses switches to see which SMA has been clicked in the form, then populates a word documents and then converts that into a PDF finally the pdf is then put that onto an email. What I am struggling with is getting the attachments from the form AND the pdf attachment onto one email. I have a sharepoint document library for where the PFD is saved to, I guess I could also make the form attachments save into the sharepoint document library also. I have linked the sharepoint document library to a SharePoint list using the MS Form ID I need power automate to be able to pick up the form ID and only pick up the attachments with that form ID. Any ideas? Hope that makes sense Thank you.
Ill add that i am building the forms using a main business email address - not my personal business address - others have access to it, but the form is not a group form so the documents being uploaded are saving to onedrive automatically. Thanks
this is the best explanation i have seen - thank you! is it possible to modify the flow so that it will not send an email if there are no attachments for a recipient?
Thank you for this post! I am only using it for the first section of your video - sending attachments by email. But I get two emails exactly the same. What could be causing the repeat?
@@DamoBird365 Yes - it appears the flow runs twice. My trigger at the top of the hierarchy is "When a file is created (properties only)" from a SharePoint folder. After that, the remaining flows are setup exactly as you illustrated in your video (essentially I replaced Manually Trigger a Flow with the SharePoint trigger as I mentioned in the first sentence).
*EDIT* - I was testing this with dropping two files in my SharePoint folder. When I dropped three files in the folder, I got three emails with the attachments - all sent at the exact same time.
Great video, thank you. For some reason after doing step by step I do not get any files attached in the email at all. Even before doing the list, just to check if I get the attachment
I will play with this for what we are needing it for in our environment. We have forms that come in that have attachments with them. I am hoping that I can grab the files that are submitted and following your steps have the files attached to the email.
¡Gracias! Great video! As I understand it, these emails would be sent to the entire list. However, in the event that there is no attachment for some contacts on the list, how could I filter out these contacts to avoid sending them emails without attachments?
I can get this flow to work when on a public site, but when I switch my files to a private team I am a member of, it no longer attaches the files. Are there additional steps for files on a private team?
No error, it will just leave off the files. I switched back my share point links to a different site and it worked fine. Might be a different issue but that’s the only difference I’m aware of
Excellent video! I’m curious how I can bundle more than one file in attachment for one person if that person have more than one AccountRef. So such person should get two different files which starts from different AccountRef number 🤔 Cheers!
Thank you so much!!! This helps immensely! The only issue I'm running into is regarding the amount of files/emails I have to send out at a time (100s). I'm getting an Aggregated error due to how many files are in the list/folder. Any way around that?
Was this the 'This exceeded the maximum size '209715200' bytes allowed' error? Basically the array is too big? I had this too - solved by doing the list excel rows first, before anything else, and using the 'filter query' option in 'Get files (properties only) so that generates the attachment array for each email / row in the spreadsheet rather than doing one big array and filtering that. Also needed to put the array in a variable because of the nested apply to each, but it worked for 244 files (each email 4 attachments).
@@jakewood79 Could you provide a screenshot of what you are describing? I'd like to mimic it because I also have a large number of attachments and the flow is taking hours and not finishing. Thank you!
Thanks for the video. I'm trying to do same thing except get attachments from a mail in outlook and resend them in another mail to a gmail account. Can't get it to work except for txt attachments :( Any advice? A pdf file attachment arrives but is just blank!
I am sure it will be possible. A common error is missing the file extension. Or putting quotes around the file content dynamic value. If you want me to take a look, drop me an email ideas@damobird365.com
This is so helpful!! I've been trying to find a way to send unique attachments to specific emails. I do have one question, on the first part where you are sending an email with all the attachments, when I receive the email there is no attachment included. Help?? Thank you in advance!!
Look back at your flow history, check the Pieter's method for creating the array. Do you have an array of filenames and file content? If you do, check the send email action, again the history, do you see anything in the output for the attachment array? If you just back into the apply to each, check your select action, has it created an object for each of the files from get files? If you expect 5 files, has the apply to each run 5 times?
@@DamoBird365 The flow history shows the get file content step is being completely bypassed. I can send you screenshots as well if that would be useful.
Actually, if your apply to each is being skipped, your get files action won't be returning any files. Have you got any files in the folder or are you using an odata filter on the action?
First of all, thank you for this educational video. Exactly what I want to do is to send the year-end reports and certificates to my students in the Excel list registered in OneDrive by attaching them to the same e-mail. Certificates and reports are saved as "student name.pdf" in different folders in OneDrive. Can you help with this?
Have you seen this video Mail : Merge to Email with Unique Attachment Power Automate ua-cam.com/video/-oz9R6pJv94/v-deo.html let me know if it helps or if requirements are different.
Hey friend, can you create a flow that send an entire folder full of pdf files, the flow must be able to select from many folders named by date for example folder 02-01, 02-02, 02.03......... etc
I’m sure it would be possible. If you can define the file paths dynamically, you could loop through the exact paths using get file content using path. learn.microsoft.com/en-us/connectors/sharepointonline/#get-file-content-using-path
@@DamoBird365 Thanks I have a project at work and I need to send automatic emails everyday sending the folder file based on the current date, that is why each folder has a different name base on a date
Hello! Would you know how I can send multiple attachments to multiple people using OneDrive? I don't have authorization to create a list in Sharepoint.
Hi Andrea, you can use the "List Files in Folder" and "Get File Content" action for OneDrive. When it comes to the list of contacts and emails, you can use a table in Excel and List Rows. Please let me know how you get on.
Does your pc recognise the file type and open in the correct application? If no, add a file extension. If yes, have you constructed the attachment compose correctly. Did you put “” around the file content, this is not a requirement.
Hi. It's possible to do this workflow but using OneDrive? I want to send and Excel file from power Bi to the email user . Each user should be able to pull his own data. I noticed I cant set up the flow to allow each user to store the the file in his own One drive account so all the file are being stored in MY One drive account but i wanted to figure out how to take those files from MY one drive to send a file to their emails every time they generate a file on my one drive account. Your workflow seems to be similar to what i need but your taks use a list of files and I just want to pick 1 file from the list. I'm able to generate the file with the user Id of the user so every file has a way to be identified but i don't know how to pick it from One drive
@@DamoBird365 Hi. I have created a report in Powe Bi and I'm planning to give access to this report to 50 persons. They want to extract data to Excel so I created a power app in my PBI dashboard to extract data from a table in my dashboard and send it via email to the user who press the button ''Extract data and send email" . This button send and csv file attached to the email. But there is an issue. The user press the button and receives one email with the file from ''Joel''. I'm Joel. but I'm not the only developer and we have other mail for issues so I don't want everybody sending emails to "me" in case of issues. There is any way to hide my name in the power app flow when sending the email with the csv file? Or any way to request approval to the user to recognize their own email accounts so the email is sended from their own accounts.. For example, Maria press the button and she receives one email from Maria to Maria..
You will need to provide more detail? How do you know the file is empty? An error? Check back on your flow history and expand each action. Try and follow the data being created. If you are still stuck, email me ideas@damobird365.com or try the forum.
@@DamoBird365 Files comes to my email. I see attachments, but when I open files I see the blank pages. Files in sharepoint folder is correct, with data(but its created from other flow) on email files blank. I use trigger "when a file is created in a folder"
drop me an email with some details and I will take a look. Are your files word/excel/text? You need to check that the file content is being supplied OK and that you have included the file extension. Look back at the history. Failing that send me some screenshots :-)
You may have worked it out, but I had this issue earlier today and the problem was with the quotation marks in the attachment array. I had, "ContentBytes": "the dynamic content variable" but it should be "ContentBytes": the dynamic content variable. I hope this helps you or someone else.
@@DamoBird365 It's possible use with smpt connection? I tried it and got error (The 'inputs.parameters' of workflow operation 'Send_Email_(V3)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SendEmailV3' is missing required property 'emailMessage/Attachments/0/ContentData'.)
thank you for the information- this is the solution that I've been looking for. But one thing, my folder contains 5 files. PA Flow was able to capture these 5 files and attach them in an email but one weird thing happened, the Power Automate flow also did send 5 Emails :( is there a solution for this behavior?
Hi there, Thanks much for this video, really a great help, however, i wanted to send the links of the attachments instead of the files. Could you please help with some directions? Very much appreciated.
@@DamoBird365 Internal users please. I've tried adding the file uri to the compose but it's giving error on the code. Please help, thank you in advance
@@DamoBird365 Thank you :) I am just so new so I keep my eyes glued to the screen so I will not miss any step. I am sure your videos have improved a lot. I really respect people like you who takes time to share knowledge :)
I get this error: Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Compose' at line '1 and column '7176' cannot reference action 'Attachment_test'. The action 'Attachment_test' is nested in a foreach scope of multiple levels. Referencing repetition actions from outside the scope is supported only when there are no multiple levels of nesting.'.'.
@@danail3783 just before the send email action. Replace the send email action with a Condition to check if the array of attachments is empty/ length 0.
ello. I've found a small problem. When there are no attachments for that given account ref it still sends an empty email. How can we fix this? would add a condition. ---> "body" contains null . plis help me
If I add everyday new files to a folder and remove old ones will it send the new attachments? Or can I just add new ones and only new ones will be attached and send?
@@DamoBird365 Hi, great vídeo!! But, I'm still very begginner, especially in Power automate. I wish you could demonstrate how to do this. I have a task that needs this filter. Thank you one more time
Your attachments are an array, based on the the get items. I would suggest you look at the last compose action, is there an array or attachments? If not, you have a problem further up the flow. Look in the apply to each, does each of the compose actions contain a file content? If not, look at the get files? Does it return any files?
Hi Ganesh, I’m afraid I cannot really help you with this as you’ve provided very little detail. It might be worth sharing your error with the forum powerusers.microsoft.com/
Hi @damobird365, I have followed all your steps and even though I have 3 pdf files in the sharepoint folder, the "Get File Content" is getting skipped with the below error, idk why? Can you please help me out? Error: ActionConditionFailed The execution of template action 'Get_file_content' is skipped: there are no items to repeat.
In case file content gives you a blank pdf this fixed it for me { "Name": "File Name", "ContentBytes": { "$content-type": "@{body('Get_file_content')['$content-type']}", "$content": "@{body('Get_file_content')['$content']}" } }
Such a crisp explanation!! Thank you sir! Working on a transit customer experience initiative that requires adding attachments for issues reported by riders. The slight difference was that you used the "get file" properties, while I did get attachment content (on a sharepoint list vs in a folder), but same thought process. Really appreciate your time!
Cheers Tanay, I really appreciate your kind feedback.
Crazy how long it took me to find this flow, exactly what I was looking for, thank you!
Nice one. I’m learning here too, how would you have searched for this video? Do you think I’ve described it right?
@@DamoBird365 Yes Damien - your description is perfect. It shows up at the top in google searches (from Canada if that makes any difference). Cheers!
After watching three of your videos (and admittedly a several hours of cursing over my typos), I am able to replace an outdated BI tool with full email automation! You are magic. Each 15-minute video took about 45 minutes to reproduce without errors. I didn't even know what Power Automat was at the start of the week. You have saved me days if not weeks of struggle. Cheers!
That is absolutely amazing stuff. Delighted to have helped you on your way 👍 brilliant to hear about what you have achieved so quickly. Thank you Patrick.
Bingo this was the flow I have been looking for all over the internet. You know what this video was in my watch later list since Aug'2021 and today I am thinking why didn't I view it last year. Better late then never. A huge thanks from side. This could have been titled as Mail Merge with dynamic attachments. Since I tried to find this flow as mail merge(just a thought).
Your Power Automate videos are the best I look to you first now when I don't know how to do something (read: do ANYTHING). Thank you!
Thank you very much. Please feel free to reach out with ideas.
Damien! thank you. Incredible video. I apply it against a database list coming from an Excel File saved in SharePoint. No issue, same concept, different filtering source for the email loop.
Awesome content. The additional step for the array solved my issue.
Thank you Damien!
I am so going to use the Compose for Array variables.
Can't believe I have been using Array variables all these while...
What a fantastic help this video is, thank you so much Damien, I don't have any files in Sharepoint but I'm hoping it might work on my OneDrive with a little bit of playing around! Wish me luck!
Thank you so much! That's wonderful! I use Excel table to store the receivers list and send out emails. It also works well.
great work, Damien. Awesome video! keep it going and thanks
Thanks Shiva
You are the Power Automate Master!!! 💪💪💪💪💪
Thanks Frank. I appreciate your kind words.
I was trying to do the multiple attachments but sending from OneDrive instead of sharepoint and even tough it creates the files all of them show up broken and they seem correct. Any idea what I am doing wrong?
Not sure, maybe best to ask on the forum powerusers.microsoft.com/t5/Forums/ct-p/FL_Comm_Forums
Hello Damien,
I was trying to figure out almost the same flow but with some differences. My flow starts with a PowerApps(V2) trigger, since it will be a button in Power Apps that will trigger the flow. I have an attachment control taken from any SharePoint list available in your databases. It’s an array of files that is dynamically added by the user of the app. What I’m trying to figure out is how to get that array of files, let’s say the user adds 3 files to the attachment control, and send them by e-mail as attachments. Would it be similar to this demo? Even if the files will probably be from either OneDrive or SharePoint.
Thanks!
Man, you simply nailed it. Awesome
Thank you so much for this! You mention that there is a way to filter your files if you're running into issues appending them to the attachment array - do you have a link or video for that by any chance??
What’s your scenario, I have a very old post/video here www.damobird365.com/easily-send-email-mail-merge-with-attachments/
simply superb! nice content and exactly what im looking for. thanks alot
Damien, me again :)
Thank you so much for your help and the content you are sharing! Like many users here, I was looking for this particular solution.
In my case, I want to include an HTML Table per user (previously created), where or how do you recommend to approach this issue? I built a flow to create an HTML Per user, considering an Excel Table with duplicates rows per user, but I want to include an Attaachment in the send an email action according to that user. I built your flow as well and it works, but I wonder how can I integrate both?
Thanks for your comments
You’ll most likely want to filter both the attachments and rows in the same loop? Hopefully they have a common key, like email address.
@@DamoBird365 Is there any chance to send you an email with images of my flow? cause I'm not sure how to do the multiple filter array
Thank you so much Damien, this is really neat! I tested your flow and it works in sending multiple attachments in PDF format. However can these attachments be embedded in a table in Outlook? When I send out these attachments in MS Outlook, each PDF file is embedded in a 2 column table to make it more presentable. So if there are 10 PDF files to be send out daily, the table will have 10 rows in a 2 column table , where 1st column is name of the report and 2nd column is the corresponding PDF file attachment. The videos for creating HTML tables doesn't really show embedding attachments. Would really appreciate any guidance you can give here. Thank you so much!
Sounds like an interesting challenge. I don’t know how to do that but understand your requirement. I can’t promise when but I will add this to a backlog of ideas. Ideally you want to see what the html of an email in outlook looks like.
Used in real life. Many thanks for this videos
Such a great solution - I was surprised that I had to go through at least a handful of useless videoes (suggesting different bad solutions) on this topic before finding this.
So glad you did this video - thank you!
Subscribing from now on :)
Thanks John - appreciated. 👍
This is great!! thank you very much for doing it!
Thanks Karen. I really appreciate folk leaving me comments like this. Makes it worthwhile 👍
Thank you so much! Been trying to work with the usual Append to an array method, but emails would always arrive without the attachments. I don't know why nobody else is sharing this method on the power apps community forum.
I personally tend to avoid variables and try to make my flows as simple as possible but I guess each to their own ideas, if it works, it works. Api calls are limited on the platform, and will be enforced from 2023, so efficient flows are something to be aware of when building a solution of your account is running multiple flows in a 24 hour period.
Great video, I really appreciate it. It’s been incredibly useful. I’m wondering though, do you have any insight on how to arrange a mail merge that functions as a follow-up to previously sent emails from an earlier mail merge?
Not something I’ve done before. Maybe one to discuss further on the forum ua-cam.com/video/d99Rr5djcME/v-deo.html 👍
Just the job. Thanks! Took me a while to work out why only first 100 attachments were being added though... Had to up the limit in the get file properties connector options.
Wow 100!! Lucky recipient 😆😂 what’s the use case? I’m always keen to hear and learn?
@@DamoBird365 hah, no, not what you think.. 27 emails with 4 attachments each. Much more reasonable!
Thank you very much for the video, I have one issue if you could help me will be greater, I did everything as you mentioned but when the email was sent, I receive it without attachments what do you think could be the issue please, I even downloaded your solution and imported to my Environments the same issue send email without attachements, unfortunately, I'm not able to send screenshots here. is there is way to show the output of the Attachment array?
You can check back in the flow history. See if you are returning files and creating an array.
@@DamoBird365 I have created a select array action to see the list of the file but I found that when I put the folder name in the Limit Entries to Folder I don't get the file list, but when I remove the folder name from the Limit Entries to folder ) and just select the Library name I get the file name in the document library!
this is the screenshot of the flow:
powerusers.microsoft.com/t5/image/serverpage/image-id/548753i64C436010D43EF62/is-moderation-mode/true/image-dimensions/2500?v=v2&px=-1
This is great! Thank you so much! I got this to work perfectly using excel instead of SharePoint once I made my table with unique rows. In the body of the email, I wanted to include a list of the attachment Names. I made several attempts, but failed miserably. Is this possible, if so how?
It would be, you just want to create an html table. You can watch
ua-cam.com/video/pwJ73jFEtDQ/v-deo.html or ua-cam.com/video/LQumCR1B-q0/v-deo.html
Hi,
Great video, very easy to follow along with.
I was wondering if you had any video's on how to do the same thing with files on OneDrive instead of SharePoint.
I'm pretty new to Power Automate/Flow and can't seem to find anything really helpful when it comes to OneDrive Multiple files.
Would really appreciate any guidance on the subject.
Thanks.
Hi Bryan, glad this has been partly useful. I don’t have one for OneDrive but I could consider it. What’s the use case? Meanwhile you could try the forum powerusers.microsoft.com/
@@DamoBird365 So I'm basically trying to achieve exactly what you have demonstrated within your video but instead of getting the files from share point I want to get the files from a OneDrive folder instead. I will only be sending to one email address which I would just hard code them in the Send Email step.
I have Googled and have gone through the power users group from that link but it all seems to be focused on files from SharePoint.
I guess as a solution I could use power automate to move the OneDrive files to a SharePoint folder and then follow your fantastic instructions but would have thought that there would be a way from OneDrive directly.
@@DamoBird365 had no luck getting the OneDrive files to attach correctly, so decided to just save the to a SharePoint location instead and then gone ahead and followed your instructions in this video.
Works perfectly. Thank you sooooo much.
wonderful tutorial thank you
Thank you Imran 👍
Great solution!!! quick question - can it be done looking for attachments in folders and subfolders?
Do you mean save attachments to different folders? Based on a sender or file name? Yes it would be possible. I’ve done something similar here ua-cam.com/video/Xv21IxI6n3U/v-deo.html
@@DamoBird365 Thanks for your quick. however, rather than uploading files what im trying to do is to attach a file to an email, but the files are in multiple subfolders (as opposed to in one single folder in sharepoint). can it be done?
Hi, thanks much for the demo. A quick question, my flow keeps failed in last email out step-- Error msg shown "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'.clientRequestId: 993e854a-c68b-417a-a36f-783a8d4b3601" ... Any way to fix that? Thanks again
It sounds like the values for to, subject and body are null or empty? Can you check the values you have provided if they are dynamic?
@@DamoBird365 yes, same steps
My flow is fine, I follow exactly your step. and the email is released but the attachment file wasn't there. Really appreciate your help on this!
thank you! very clear, but in my case the file attached are not usable because they are reported as corrupted. any hint how to solve? they are 3 excel without macros, in a sharepoint folder exactly as your example. thank you!
have you included the extension and I think you need to exclude the " " from content bytes, but my mind escapes me just now. These would be the two things I would check.
I have a flow that gets images from a OneDrive folder via their ID and adds them to an array variable.
I then want to send an email with that array attached using the SMTP (Send Email v3) connector, but it always errors and the email never gets sent.
Can you possibly make a video on how to do this? I get this error:
'SendEmailV3' is missing required property 'emailMessage/Attachments/0/ContentData'
Thank you so much!!
Hi Ian I would need to get myself sorted with smtp details. Any reason why you use this over the outlook connector?
@@DamoBird365 Because I need the flow to send out from an email address that is a distribution list. With the Outlook connector that doesn't seem possible.
hi got this to work which is great...but is there anyway of filtering the documents to be attached to email by a field value in sharepoint list? ie say if i have column1 , column2, column 3 etc set as yes /no fields in list. If column1 = Yes then include document 1, if column2 = Yes then include document 2 etc. So documents from library would be filtered and added to email on these columns being yes? thanks
I was going to say Two options, you can filter via advanced options, column1 eq ‘yes’ or column2 eq ‘yes etc or you can use filter array but if I’ve understood you, you’ve got a column per document? I think this could still be done via a filter array, with a dynamic column name but would have to try it. If you want to send me a sample ideas@damobird365.com.
@@DamoBird365 I have the same situation Mark had, and I'm not sure I quite follow your reply. In my case, I have 3 document files that I'd like sent to the list item creator depending on the yes/no conditions they specified in their list form submission. So if they specify on the SP list they need form 1 and form 3 (a yes/no column for each of the forms), an email sends with form 1 and form 3 only. To do that, which "advanced options" filter were you referring to above?
@@erichko odata filter on get files, it’s usually hidden under advanced on that action.
Thanks alot! I've built as per your video but when the flow runs, it sends me the same number of emails as there are attachments. I.e. if there are 4 attachments, it emails me 4 times. The emails all have the 4 attachments in them. Any ideas? When i've looked at the run history, there are 4 instances of the 'apply to each' so is it looping? If so how do i stop it? Thanks
The apply to each should run 4 times if there are 4 attachments but then outside of the loop, you should send the email. Sounds like you have an apply to a each for sending the email too, which is unexpected.
@@DamoBird365 Thanks, i figured it out. I was using the 'when a file is created' step but didn't think (don't know why) that it'd run each time i moved a file over so it was running it four times. I've changed it do run on a daily recurrence and has resolved my problem. Great video though!
Thank you for you time , excelent !!
Thanks Damien.. I was using Array to append the File content. Which was working for small files but when I use large files it show the Array size issue. Array can't hold beyond certain limit ( I think 100mb). After using Compose it work perfect.
Good share 👍 thanks
Hi, great video thank you,
I have a senario that im working through at the moment which I hope you can lend a hand with
I have a MS form which allows for attachments
The form splits depending into sections depending on the user choosing a subject matter area.
Power automate uses switches to see which SMA has been clicked in the form, then populates a word documents and then converts that into a PDF finally the pdf is then put that onto an email.
What I am struggling with is getting the attachments from the form AND the pdf attachment onto one email.
I have a sharepoint document library for where the PFD is saved to, I guess I could also make the form attachments save into the sharepoint document library also. I have linked the sharepoint document library to a SharePoint list using the MS Form ID
I need power automate to be able to pick up the form ID and only pick up the attachments with that form ID.
Any ideas?
Hope that makes sense
Thank you.
Ill add that i am building the forms using a main business email address - not my personal business address - others have access to it, but the form is not a group form so the documents being uploaded are saving to onedrive automatically. Thanks
this is the best explanation i have seen - thank you!
is it possible to modify the flow so that it will not send an email if there are no attachments for a recipient?
You could use length() on the attachment array. It can be used in a condition.
@@DamoBird365 that worked - thanks
Thank you for this post! I am only using it for the first section of your video - sending attachments by email. But I get two emails exactly the same. What could be causing the repeat?
Does the flow run twice? What trigger are you using? Or do you have an apply to each loop for sending the email? I need a bit more info to understand.
@@DamoBird365 Yes - it appears the flow runs twice. My trigger at the top of the hierarchy is "When a file is created (properties only)" from a SharePoint folder. After that, the remaining flows are setup exactly as you illustrated in your video (essentially I replaced Manually Trigger a Flow with the SharePoint trigger as I mentioned in the first sentence).
*EDIT* - I was testing this with dropping two files in my SharePoint folder. When I dropped three files in the folder, I got three emails with the attachments - all sent at the exact same time.
Great video, thank you. For some reason after doing step by step I do not get any files attached in the email at all. Even before doing the list, just to check if I get the attachment
I will play with this for what we are needing it for in our environment. We have forms that come in that have attachments with them. I am hoping that I can grab the files that are submitted and following your steps have the files attached to the email.
I was able to figure this out, if anyone is interested.
Yea actually im interested to know how did u manage it
@@abody44ever Do you have another way to communicate outside of UA-cam?
Great video!
Incredible!
Is it possible to send only those attachments who are first selected in the sharepointlist ?
¡Gracias! Great video! As I understand it, these emails would be sent to the entire list. However, in the event that there is no attachment for some contacts on the list, how could I filter out these contacts to avoid sending them emails without attachments?
Hey Thanks 🙏 you could add a condition where length() of array is greater than 0?
@@DamoBird365 where is add condition please
I can get this flow to work when on a public site, but when I switch my files to a private team I am a member of, it no longer attaches the files. Are there additional steps for files on a private team?
Do you get an error? I don’t know the exact answer but a SharePoint private channel is another SharePoint site.
No error, it will just leave off the files. I switched back my share point links to a different site and it worked fine. Might be a different issue but that’s the only difference I’m aware of
need to get all files based on modified date. please help me.
Excellent video! I’m curious how I can bundle more than one file in attachment for one person if that person have more than one AccountRef. So such person should get two different files which starts from different AccountRef number 🤔 Cheers!
I would use filter array to get the attachments based on those refs.
My images are not opening on preview(after the flow runs) for some reason as they are not in the correct file format.
You would need to provide more detail. Maybe ask on the forum powerusers.microsoft.com/
thankyou sir, godbless you
Thank you so much!!! This helps immensely! The only issue I'm running into is regarding the amount of files/emails I have to send out at a time (100s). I'm getting an Aggregated error due to how many files are in the list/folder. Any way around that?
Hi, is it an error or a warning? Can you send me a screenshot? Ideas@damobird365.com
Was this the 'This exceeded the maximum size '209715200' bytes allowed' error? Basically the array is too big? I had this too - solved by doing the list excel rows first, before anything else, and using the 'filter query' option in 'Get files (properties only) so that generates the attachment array for each email / row in the spreadsheet rather than doing one big array and filtering that. Also needed to put the array in a variable because of the nested apply to each, but it worked for 244 files (each email 4 attachments).
@@jakewood79 top effort, thanks for sharing!
@@jakewood79 Could you provide a screenshot of what you are describing? I'd like to mimic it because I also have a large number of attachments and the flow is taking hours and not finishing. Thank you!
Thanks for the video. I'm trying to do same thing except get attachments from a mail in outlook and resend them in another mail to a gmail account. Can't get it to work except for txt attachments :( Any advice? A pdf file attachment arrives but is just blank!
I am sure it will be possible. A common error is missing the file extension. Or putting quotes around the file content dynamic value. If you want me to take a look, drop me an email ideas@damobird365.com
Thanks man !!!
Can this be done when currently using Excel to keep file email addresses/key account info (BS01) and attachments(BS01xxxx) in OneDrive?
Yes, you can. Replace the list with an excel workbook and filter on the results of the excel table. Please let me know how you get on.
This is so helpful!! I've been trying to find a way to send unique attachments to specific emails. I do have one question, on the first part where you are sending an email with all the attachments, when I receive the email there is no attachment included. Help?? Thank you in advance!!
Look back at your flow history, check the Pieter's method for creating the array. Do you have an array of filenames and file content? If you do, check the send email action, again the history, do you see anything in the output for the attachment array? If you just back into the apply to each, check your select action, has it created an object for each of the files from get files? If you expect 5 files, has the apply to each run 5 times?
@@DamoBird365 The flow history shows the get file content step is being completely bypassed. I can send you screenshots as well if that would be useful.
Try me on Ideas@damobird365.com and I will do my best to help
Actually, if your apply to each is being skipped, your get files action won't be returning any files. Have you got any files in the folder or are you using an odata filter on the action?
@@DamoBird365 Same here! Get file content is being bypassed and grayed out in the run history. Could you please help?
First of all, thank you for this educational video.
Exactly what I want to do is to send the year-end reports and certificates to my students in the Excel list registered in OneDrive by attaching them to the same e-mail. Certificates and reports are saved as "student name.pdf" in different folders in OneDrive.
Can you help with this?
Have you seen this video Mail : Merge to Email with Unique Attachment Power Automate
ua-cam.com/video/-oz9R6pJv94/v-deo.html let me know if it helps or if requirements are different.
Hey friend, can you create a flow that send an entire folder full of pdf files, the flow must be able to select from many folders named by date for example folder 02-01, 02-02, 02.03......... etc
I’m sure it would be possible. If you can define the file paths dynamically, you could loop through the exact paths using get file content using path. learn.microsoft.com/en-us/connectors/sharepointonline/#get-file-content-using-path
@@DamoBird365 Thanks I have a project at work and I need to send automatic emails everyday sending the folder file based on the current date, that is why each folder has a different name base on a date
Definitely sounds possible, this video might also help with dates ua-cam.com/video/ybPWtu1i1j0/v-deo.html.
Hello! Would you know how I can send multiple attachments to multiple people using OneDrive? I don't have authorization to create a list in Sharepoint.
Hi Andrea, you can use the "List Files in Folder" and "Get File Content" action for OneDrive. When it comes to the list of contacts and emails, you can use a table in Excel and List Rows. Please let me know how you get on.
hi, thank for your video, I have a problem. Mails arrives but files attacheds are corrupted? any idea? tk
Does your pc recognise the file type and open in the correct application? If no, add a file extension. If yes, have you constructed the attachment compose correctly. Did you put “” around the file content, this is not a requirement.
@@DamoBird365 many thanks, i removed the "" and now it works!!! 👍👍👍👍👍👍👍👍
The golden tip is: mark "no" on tech selection -> Include Nested Items in Get items - properties only phase
Thanks for sharing your findings Rodrigo 👍
thanks for this! I wasted lot of hours in understanding why get file content step was being bypassed.
@@chandanar9866 happy to help, I took long to discover it as well : )
thanks for this comment
Hi. It's possible to do this workflow but using OneDrive? I want to send and Excel file from power Bi to the email user . Each user should be able to pull his own data. I noticed I cant set up the flow to allow each user to store the the file in his own One drive account so all the file are being stored in MY One drive account but i wanted to figure out how to take those files from MY one drive to send a file to their emails every time they generate a file on my one drive account.
Your workflow seems to be similar to what i need but your taks use a list of files and I just want to pick 1 file from the list. I'm able to generate the file with the user Id of the user so every file has a way to be identified but i don't know how to pick it from One drive
What trigger are you using?
@@DamoBird365 Hi. I have created a report in Powe Bi and I'm planning to give access to this report to 50 persons. They want to extract data to Excel so I created a power app in my PBI dashboard to extract data from a table in my dashboard and send it via email to the user who press the button ''Extract data and send email" . This button send and csv file attached to the email.
But there is an issue. The user press the button and receives one email with the file from ''Joel''. I'm Joel. but I'm not the only developer and we have other mail for issues so I don't want everybody sending emails to "me" in case of issues.
There is any way to hide my name in the power app flow when sending the email with the csv file? Or any way to request approval to the user to recognize their own email accounts so the email is sended from their own accounts.. For example, Maria press the button and she receives one email from Maria to Maria..
This is genius.
Thanks Felix
how do we differentiate between ID and Identifier if the file is in a OneDrive folder?
I believe that id is your item id, whereas identifier is the unique file identifier guid.
@@DamoBird365 I ended up moving my files over to our SP site and your method worked *perfectly* the first time. A+, thank you.
Thank You for this instruction. I try you instruction and other, but everytime files comes empty. What I do wrong?
You will need to provide more detail? How do you know the file is empty? An error? Check back on your flow history and expand each action. Try and follow the data being created. If you are still stuck, email me ideas@damobird365.com or try the forum.
@@DamoBird365 Files comes to my email. I see attachments, but when I open files I see the blank pages. Files in sharepoint folder is correct, with data(but its created from other flow) on email files blank. I use trigger "when a file is created in a folder"
drop me an email with some details and I will take a look. Are your files word/excel/text? You need to check that the file content is being supplied OK and that you have included the file extension. Look back at the history. Failing that send me some screenshots :-)
You may have worked it out, but I had this issue earlier today and the problem was with the quotation marks in the attachment array. I had, "ContentBytes": "the dynamic content variable" but it should be "ContentBytes": the dynamic content variable. I hope this helps you or someone else.
@@DamoBird365 It's possible use with smpt connection? I tried it and got error (The 'inputs.parameters' of workflow operation 'Send_Email_(V3)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SendEmailV3' is missing required property 'emailMessage/Attachments/0/ContentData'.)
thank you for the information- this is the solution that I've been looking for. But one thing, my folder contains 5 files. PA Flow was able to capture these 5 files and attach them in an email but one weird thing happened, the Power Automate flow also did send 5 Emails :( is there a solution for this behavior?
You must have the send email action in an apply to each somewhere.
nice
Hi there, Thanks much for this video, really a great help, however, i wanted to send the links of the attachments instead of the files. Could you please help with some directions? Very much appreciated.
I don’t have a video for that yet I’m afraid. What’s your use case? Internal or external users?
@@DamoBird365 Internal users please. I've tried adding the file uri to the compose but it's giving error on the code. Please help, thank you in advance
If you use get file properties action, it has a dynamic value "link to item".
Awesome instruction. The video is a tad blurry :(
Hopefully if you watch one of my more recent videos (this is 2 years old), you will see some improvements but I am always learning. Thanks
@@DamoBird365 Thank you :) I am just so new so I keep my eyes glued to the screen so I will not miss any step. I am sure your videos have improved a lot. I really respect people like you who takes time to share knowledge :)
I get this error:
Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Compose' at line '1 and column '7176' cannot reference action 'Attachment_test'. The action 'Attachment_test' is nested in a foreach scope of multiple levels. Referencing repetition actions from outside the scope is supported only when there are no multiple levels of nesting.'.'.
It sounds like you’ve got yourself into nested apply to each loops. ua-cam.com/video/d99Rr5djcME/v-deo.html
Hello. I've found a small problem. When there are no attachments for that given account ref it still sends an empty email. How can we fix this?
You could try adding a condition so that if the length of the array is 0 I.e. no attachments, branch one way, Otherwise send email with attachments?
@@DamoBird365 where exactly in the flow ?
@@danail3783 just before the send email action. Replace the send email action with a Condition to check if the array of attachments is empty/ length 0.
What if the attachments you wish to send are currently stored in different document folder locations?
You could get the several files and use union() to join the arrays of attachments.
Hello how can I send to multiple users
thank you
No problems. I hope you got what you’re looking for.
ello. I've found a small problem. When there are no attachments for that given account ref it still sends an empty email. How can we fix this? would add a condition. ---> "body" contains null . plis help me
For your scenario you could add a condition to check the length() of the attachments array. If greater than 0, send an email, otherwise don’t.
@@DamoBird365
Does that stream go after "filter array"? .
it would be something like:
length('Name') is greater than '0'
please help me
Hopefully this will help m.ua-cam.com/video/6nJSUNh579w/v-deo.html jump to 11:38 👍
@@DamoBird365 Thank you very much problem solved, new subscriber
@@paulanarvaez7346 thanks, glad you got sorted. If there’s ever a problem use case for a video, feel free to drop me a message. 👍
I am having trouble getting multiple attachments to send
Really difficult to diagnose. I would suggest you post more detail on the forum powerusers.microsoft.com/
If I add everyday new files to a folder and remove old ones will it send the new attachments? Or can I just add new ones and only new ones will be attached and send?
If using get files, it would send them all but you could filter on created date, if you want to limit to new files.
@@DamoBird365 Hi, great vídeo!! But, I'm still very begginner, especially in Power automate. I wish you could demonstrate how to do this. I have a task that needs this filter. Thank you one more time
what if there are no attachments submiited via a form for e.g. will this flow fail?
The flow will not fail. The compose will be empty and therefore no attachments will be sent.
Can you share the flow, bro?
github.com/DamoBird365/PowerAutomate/blob/main/UA-camDemos/HowToSendMultipleAttachmentsviaEmail.zip
@@DamoBird365 Many thanks, bro
Hi I did everything correctly, the email was sent, but no attachments what do you think is the problem
Your attachments are an array, based on the the get items. I would suggest you look at the last compose action, is there an array or attachments? If not, you have a problem further up the flow. Look in the apply to each, does each of the compose actions contain a file content? If not, look at the get files? Does it return any files?
@@DamoBird365 starting to lose hope about this haha I followed everything correctly, :(
I think it has something to do with the file path, Im a bit confused
@@clarencemartantonio4708 you can email me a screenshot ideas@damobird365.com
@@DamoBird365 I sent you an email sir
You have sent attachments to one email id only. How to send Same attachments to multiple emails?
Just create a semi colon separated list of emails.
@@DamoBird365 suppose I want to send email to 100s emails, then ??
How to send unique attachments to multiple emails??
You would need a field with unique data to filter on but it’s definitely doable. Using filter array.
@@DamoBird365 can you make video on my query or question?
getting an error
after applied last filter
Hi Ganesh, I’m afraid I cannot really help you with this as you’ve provided very little detail. It might be worth sharing your error with the forum powerusers.microsoft.com/
Hi @damobird365,
I have followed all your steps and even though I have 3 pdf files in the sharepoint folder, the "Get File Content" is getting skipped with the below error, idk why? Can you please help me out?
Error: ActionConditionFailed
The execution of template action 'Get_file_content' is skipped: there are no items to repeat.
It would mean that the input to your apply to each is empty.
In case file content gives you a blank pdf this fixed it for me
{
"Name": "File Name",
"ContentBytes": {
"$content-type": "@{body('Get_file_content')['$content-type']}",
"$content": "@{body('Get_file_content')['$content']}"
}
}