Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How to build flow that sends email with attachments

Like (1) ShareShare
ReportReport
Posted on 24 Jul 2024 19:37:51 by 21
I am new to creating flows and have been watching videos/reading threads to help get me to the flow I currently have. That being said I am unable to figure out the next step to get my flow working correctly. I am trying to set up a flow that is triggered when an item in the list it set as "completed". I want the flow to send an email to a few users and include any attachments that were uploaded in reference to that item. Usually just 2 files, an excel and a pdf file. The set up I currently have is as follows: When an item or a file is modified>Get changes for an item or a file (properties only)>Condition. 
 
I am attaching screenshots of what my "Condition" action includes. When testing my flow, I am receiving the email with an attachment that does not have a file extension, test results are showing that the flow is successful. The attachment gives me an error when trying to open it. I do not know how to tell the flow to gather and send the attachments properly. I have tried seeing help videos but am unable to comprehend or just don't know at all how to make them work with my flow. I am attaching screenshots of the way the file attachment is coming in through email and the error I get when I try to open it. Error says: "Adobe acrobat cannot open (test 002) because it is either not a supported file type or the file has been damaged (for example, it was sent as an email attachment, and wasn't correctly decoded).
 
I need the email attachment name to appear just the same as what was uploaded to the list. Any help is appreciated. Please let me know if screenshots are not helpful or blurry. I want to mention that this is not the entirety of what I need my flow to do. I am also wanting the flow to save the attachments that are being emailed into a specific drop box folder. Don't know if this extra action will make a difference in the way my flow needs to be set up. I have tried to take it one step at a time and figured it would be best to get the email attachment part working first before moving on to this next action. 
  • yellowsquirrel Profile Picture
    21 on 02 Aug 2024 at 14:46:56
    How to build flow that sends email with attachments
    I have tried searching in both the file manager and the Dropbox website but still no luck. I know my search function is working because a previous test attachment does appear from last year, just not this one :/
  • MuchTooMany Profile Picture
    26 on 01 Aug 2024 at 05:46:38
    How to build flow that sends email with attachments
    Looking at the outputs, the flow is working. You can see it's creating a file with a name and a size > 0.
     
    Can you try searching your dropbox instance for the test filename rather than navigating to where you think it should be?
     
     
  • yellowsquirrel Profile Picture
    21 on 30 Jul 2024 at 15:23:34
    How to build flow that sends email with attachments
    The folders seem to be shared. I have no indication that leads me to believe they are team folders. It is confusing to me because of the folder with my name that is independent of the other folders. I need the attachments to be accessible by all the other members. Currently there is files in that folder, the folder I need the attachments to be saved, and those files are available to all our members. I have attached the screenshots of the outputs for using both paths (with and without my user folder). 
     
     
  • MuchTooMany Profile Picture
    26 on 30 Jul 2024 at 08:05:06
    How to build flow that sends email with attachments
    I have tested the dropbox create file on my personal computer and it works. 
     
    However, there are 2 things with this: 1) I don't have sharepoint on that so I used OneDrive instead, and 2) my personal dropbox is just mine, so not a shared business one.
     
    I was able to get the filename and content from OneDrive 'When a file is created' and then use those in the dropbox 'Create file' action. Do note that this is not the OneDrive for Business connector - if you use that you don't get the file content from create file and would need to use the 'Get file content' action afterward.
     
    Reading the dropbox documentation, this seems pertinent:
     
     
    The folder with your name is clearly personal. Are the others shared or team?
     
    Could you share a screenshot of the dropbox action output from the successful ("green") run?
  • yellowsquirrel Profile Picture
    21 on 29 Jul 2024 at 16:57:50
    How to build flow that sends email with attachments
    Thank you, the flow runs as successful, but no email attachments are to be found in the folder. The Dropbox is a company shared Dropbox. I hardly ever access the Dropbox through my browser, rather I have it set up to where the folders I need are synced to my desktop. When I click on the little folder icon in the "Folder Path" blank, there are two options that are given as paths. One option shows my name as the first folder, the other options does not show my name as a folder to the path.  The folder with my name is not a folder I manually created, I guess it's just like my user folder..? I've tried it with and without my name in the first part of the Folder Path, both tries give me green test results but still no file to be found in folder. Do you have any advice??
     
  • MuchTooMany Profile Picture
    26 on 27 Jul 2024 at 16:51:04
    How to build flow that sends email with attachments
    Ah, yes, because the DisplayName is an array so it puts it into an apply to each. My bad.
     
    As we're happy the attachments are being emailed correctly, we can create the file in dropbox first before it sends.
     
    Move the dropbox create file action to 'Apply to each' under your append to array action. That should give you access to all the dynamic data and you can test whether it works writing the files to the folder in dropbox.
  • yellowsquirrel Profile Picture
    21 on 26 Jul 2024 at 15:18:22
    How to build flow that sends email with attachments
    Thank you for trying to help out. It was definitely worth a try, however when using the "create file" option, "attachment content" is not an option from the dynamic content list. I will create new question for this part of my flow to try to get some more feedback. Also, for some reason I am not able to set your answer as the solution. I have been trying endlessly since yesterday. When I click on "Does this answer your question", all it does is show the little circle loading and never performs the action no matter how long I let it load and does the same on both Microsoft edge and Chrome browser :[ .. If you want I can repost same question and try again to set your reply as answer..? Don't know if you would be able to find my question again though..?
     
  • MuchTooMany Profile Picture
    26 on 25 Jul 2024 at 16:44:34
    How to build flow that sends email with attachments
    I'm glad I could help. Please mark my reply as the answer to help others in future.
     
    I don't use Dropbox so I am unfamiliar with it in practice. However, looking at the dropbox 'create file' action you need to define the folder, filename and file content.
     
    You could try adding the dropbox create file action after the email action, defining the folder you want the attachments to go into, and then use the dynamic content you used in append to array variable (DisplayName & Attachment content) for the filename and content.
     
    As I say, I don't have dropbox so I am only surmising, but it's worth a try.
  • yellowsquirrel Profile Picture
    21 on 25 Jul 2024 at 15:14:09
    How to build flow that sends email with attachments
    Thank you @MuchTooMany! It is working and I'm able to send multiple attachments in a single email! Would you be able to guide me in how to get the attachments that have been emailed to save to Dropbox. I'm afraid the flow is now beyond my comprehension and have no clue how to approach this part. 
     
     
  • MuchTooMany Profile Picture
    26 on 25 Jul 2024 at 05:09:18
    How to build flow that sends email with attachments
    No problem, but I can't see the array variable or Get attachment content action?
     
    • Add the initialize variable action before your Condition. Give it the name 'Attachments', set the type to array, and leave the value blank. 
    • Add the 'Get attachment content' action after Get attachments in your switch case - set the Id to 'ID' from When an item or file is modified, and the file identifier to 'id' from Get attachments. This will put it into an apply to each container.
    • Add the 'Append to array variable' action after Get attachment content in the apply to each. Set the value as the code below, where the name  is 'DisplayName' from the dynamic content of Get attachments, and ContentBytes is the dynamic data 'Attachment content' from Get attachment content. No spaces after the colon/before the comma.
    {
    "Name": ,
    "ContentBytes": 
    }
    • Delete your apply to each container and recreate your email action. On your email action, click the 'Switch to input entire array' option and add the dynamic content from your variable.
    • Save and test.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 101

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 60 Super User 2025 Season 1

Overall leaderboard