web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send emails with attac...
Power Automate
Suggested Answer

Send emails with attachments from Powerapps

(1) ShareShare
ReportReport
Posted on by 19
Hello!
 
I am trying to send an email from a button trigger on powerapps but include attachments. 

On PowerApps I am selecting multiple items from a gallery using a check box. OnCheck, I am collecting all checks and creating a collection called colPickUp which could have many rows with different items. 

Inside a list, those items have attachments.
 
On PowerAutomate i was able to create the email and send it with the subject and body I want, but I am trying to figure out how to have a way to get attachments and then include them all in the email.
 
What I did was below:
I connected the sharepoint and the list name, but I was wondering how to get all of the IDs in the collection (or if that's even possible).
Example, if my collection has ID 1 on row 1 and ID 2 on row 2, I wanted to get the attachments on both ID's. 
 
 
And then How can I send it through email? On powerautomate i have:
 
but not sure how to include the attachments.
 
Thanks!
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,031 Moderator on at
     
    If you're trying to send attachments from multiple SharePoint items in a single email, you’ve probably noticed that the Get attachments action only accepts one ID at a time. It doesn’t support passing a collection directly, but there’s a standard workaround.

    Collect all attachments into an array as the flow runs, then pass that array into the email action at the end.
     
    Steps
    1. Initialize an array
    At the start of the flow, add an Initialize variable action:
    Name: varFiles
    Type: Array
    Leave it empty
     
    2. Loop through selected items
    Use an Apply to each loop over the IDs coming from Power Apps.
     
    3. Get attachments (metadata)
    Inside the loop, use Get attachments with the current item ID.
    4. Get attachment content
    Add a nested loop (since each item can have multiple files), and use Get attachment content to retrieve the file data.
     
    5. Build the array
    Use Append to array variable with this structure:
    {
      Name: DisplayName,
      ContentBytes: Attachment Content
    }
     
    6. Send the email
    After the loops (outside of loop):
    Add Send email (V2)
    In the attachments field, switch to “input entire array”
    Use varFiles
     
    Summary
    Since SharePoint attachments are item-based, you need to fetch them per item and aggregate them yourself. Once they’re in an array, sending them in one email becomes straightforward.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

    Sunil Kumar Pashikanti, Moderator
    Blog:
     https://sunilpashikanti.com/posts/
  • Suggested answer
    Valantis Profile Picture
    4,793 on at
     
    Good question. The key is passing all the IDs from Power Apps to the flow, then looping through them in Power Automate to collect all attachments before sending the email.
    In Power Apps, when you trigger the flow from the button, pass the IDs as a JSON string:
    YourFlow.Run(JSON(ShowColumns(colPickUp, "ID")))
    This converts your collection to a JSON array like [1, 2, 3] and sends it to the flow as a text parameter.
    In Power Automate:
    1. Accept the IDs as a text input parameter
    2. Add a Parse JSON action to convert the text back to an array. Use schema: { "type": "array", "items": { "type": "object", "properties": { "ID": { "type": "integer" } } } }
    3. Initialize a variable (array type) called varAttachments
    4. Add an Apply to each loop over the parsed JSON array
    5. Inside the loop: Get attachments (SharePoint) using the current item's ID
    6. Add another Apply to each loop inside for each attachment returned
    7. Inside the inner loop: Get attachment content (SharePoint) using the attachment's ID and file name
    8. Append to array variable: { "Name": attachment file name, "ContentBytes": attachment content }
    9. After both loops: Send an email (V2) and in the Attachments field, use the varAttachments array
    The Send email V2 action accepts attachments as an array with Name and ContentBytes properties, so this maps directly.
    One thing to confirm: in your Get attachments action, connect it using the same SharePoint site and list, and set the Item ID to the ID from your loop's current item. If your column name in the collection is different from "ID", adjust the JSON column name accordingly.
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard