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 / Sending an attachment ...
Power Automate
Answered

Sending an attachment from a SharePoint List using PowerApps

(1) ShareShare
ReportReport
Posted on by 6
Hi Everyone:
 
Very new to Power Automate and PowerApps.  Thank you for answering my question.  
 
I have a list with a file attachment in a SharePoint List
In Power Apps, I have an email Icon and when it is clicked on, it will send an email with the attachment.
I am using Get Attachments and Get Attachment Content
 
In both of these items there is an Id field
And both, using Dynamic Content, the ID field does not show up
In my list, I know ID = 66 has an attachment
If I put 66 in both of these fields, it works!
But I don't what this hard coded, I want whatever list item is selected, it will pick up the ID and send that attachment
How do I pick up this ID?
 
 
 
 
 
Categories:
I have the same question (0)
  • Verified answer
    Sam_Fawzi Profile Picture
    898 Super User 2026 Season 1 on at
     
    The reason the ID is not showing in Dynamic Content is because your flow is triggered from Power Apps, not directly from SharePoint. So Power Automate doesn’t automatically know which list item you’re referring to , unless you pass that ID from Power Apps.
    That’s why hardcoding 66 works, but it’s not dynamic.
    Here’s what you should do:
    In Power Automate
    • Use PowerApps (V2) as the trigger.
    • Add an input parameter (Number) — call it something like ItemID (Ask in PowerApps).
    • In both Get attachments and Get attachment content, set the Id field to that ItemID parameter instead of hardcoding 66.
    In Power Apps
    When calling the flow from your email icon, pass the selected item’s ID:
    YourFlowName.Run(ThisItem.ID)
    (or Gallery1.Selected.ID if you’re using a gallery)
    This way, the flow will always use the ID of the selected list item and pick up the correct attachment dynamically.

    Let me know if you’d like help structuring the attachment array for the email step as well.
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,118 Super User 2026 Season 1 on at
    Hi,
     
     
    In PowerApps, On Email Icon click: PowerAutomateFlow.Run(Gallery1.Selected.ID). This sends selected item ID to flow trigger parameter.
    ​
    Flow trigger has Ask in PowerApps parameter. Use triggerBody()['number'] in "Get item" ID field use Gets full item details.
    ​
    Use Get attachments from Site ID field: body('Get_item')?['ID'] from dynamic content. Now shows correct attachment for selected item.
    ​
    Get attachment content same List ID: body('Get_item')?['ID'], File ID: body('Get_attachments')?['value']?[0]?['Id'].
    ​
    Use Send Email and pass the Content of attachment and pass file name
    Attachments field
    Name: body('Get_attachments')?['value']?[0]?['Name']
    Content: body('Get_attachment_content')?['body']
     
     
    Note: For Multiple files
    JSON Format Required
    Attachments needs array format:
    text
    [
      {
        "Name": "filename.pdf",
        "ContentBytes": "@{body('Get_attachment_content')?['body']}"
      }
    ]
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • ByteLogic Profile Picture
    6 on at
    Thank you so much, Sam.  I went your solution.
    You were absolutely right when you said to change to Power Apps (v2), I had it at Manual Trigger.
     
     
     
     
    But I did have to make a small adjustment to the Power Apps code:
     OnSelect ='PowerAppV2->Getattachments'.Run({number:(ThisItem.ID)})
     
    I am about to post another question about this flow, but I think it needs to go under a different title.  
     

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
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard