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 / Getting multiple attac...
Power Automate
Answered

Getting multiple attachments from SharePoint list item and sending one specific attachment in an email

(0) ShareShare
ReportReport
Posted on by 90

Hello all!

What I am trying to achieve is the following:

 

  1. get a specific attachment from an item in a SharePoint list (the item will at most have two attachments, but it's not always going to be two - the item is exclusively going to be a PDF file)
  2. Take that attachment > place it into an array
    1. That array already has a file in it that we got from a SharePoint library previously in the same flow
  3. Attach those files into an email for the recipient to open

 

I am mostly having issues with getting a specific attachment within the item. I had this idea of looping through the attachments column in the item and using a check condition based on it's DisplayName as I have captured the attachments name in a previous flow. Kinda looks like this:

jojos_iq_0-1682298355395.png

If true, it attempts to get the attachment content and then we try and place it into the array:

jojos_iq_2-1682298762545.png

 

ContentBytes = body('Get_attachment_content')['$content']

The name has been grabbed from the item itself - a column where we previously captured the name of the file already which includes the file extension

 

 

I'm just not too confident on the syntax of the Set Variable module. Trying to append it to the array gives me this error:

jojos_iq_3-1682298863033.png


What am I doing wrong here? Please help me 😞

If you need any additional information, please let me know



Categories:
I have the same question (0)
  • Verified answer
    jojos_iq Profile Picture
    90 on at

    Okay never mind I solved it (That's classic really - you explain the problem and how the thing is meant to work and then you figure it out)

    I was using "Set Variable" not "Append to array variable" - literally, as soon as I changed it, it worked.

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 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard