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!
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).
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.
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!
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.
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 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??
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.
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
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?
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.
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!
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-pwJ73jFEtDQ.html or ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-LQumCR1B-q0.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.
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
¡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?
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?
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.
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?
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.
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
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.
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
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--oz9R6pJv94.html let me know if it helps or if requirements are different.
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Xv21IxI6n3U.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?
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!
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.'.'.
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?
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 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
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
@@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 :)
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.
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
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..
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
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.
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!
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
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?
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?
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.
@@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.
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
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
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'.)
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/
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']}" } }
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.