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 / Attach multiple ShareP...
Power Automate
Answered

Attach multiple SharePoint files to a single email message

(0) ShareShare
ReportReport
Posted on by 28

I created a flow that grabs some files and zips them up, then emails me the zip file. That is working fine -- the right files are in the zip file, which is attached to the email. Then, I thought, why bother zipping them up -- just attach them. I figured I could just remove the zip step, and put the array variable in as the attachment, but it's sending me an email message with no files attached. Is there an additional step that I need? Here's my current flow...

 

Capture.JPGCapture2.JPG

 

I've read through several posts on here about attaching multiple files, and I've tried the different JSON in the append variable step, but the same result each time. I've been looking at this for five hours and I'm nearing the point of insanity. If it passes the files to be zipped, shouldn't it attach them? What am I missing?

 

Thank you so much to anyone who can help.

Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @tcaruso 

    Do you see an error?  If so, can you post a screen shot of the error? How large are the files?

     

     

     

  • tcaruso Profile Picture
    28 on at

    I don't get an error, and in fact, the Flow reports that it runs successfully. Is there a logging thing that I can turn on? I only know how to see that kind of thing in testing mode, but as I say, it's succeeding.

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @tcaruso 

    The best thing to do right now is to look at your last run.  Look at the output of each action, etc..  Does it look like the data and files that you expected to be there are actually there?  Doe your variable look like it has data?

     

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @tcaruso 

    I just noticed that I I believe you have the wrong value selected for file identifier in your get attachment content action (it's a bit confusing).  See my screen shot below:

    WrongID.png

  • tcaruso Profile Picture
    28 on at

    I'm not using a "get attachments", because I'm using files not list items. I tried that, but every "get attachments" option wants a list name.

  • tcaruso Profile Picture
    28 on at

    I might need some assistance in doing so. Does the fact that the same flow previously sent the files correctly to the zipping action not indicate that those steps are working correctly?

     

    I can see that it's stepping through the files...

     

    Capture.JPG

     

    I didn't include the file names in the screen shot so that I didn't have to anonymize it, but the file names are correct. When I hit the outputs download, I get this...

     

    {"statusCode":200,"headers":{"Transfer-Encoding":"chunked","X-SharePointHealthScore":"1","X-MS-SPConnector":"1","X-SP-SERVERSTATE":"ReadOnly=0","DATASERVICEVERSION":"3.0","X-Download-Options":"noopen","SPClientServiceRequestDuration":"139","SPRequestGuid":"5a139384-6e52-4db5-89e4-27f6fda2d0cd","request-id":"5a139384-6e52-4db5-89e4-27f6fda2d0cd","MS-CV":"hJMTWlJutU2J5Cf2/aLQzQ.0","Strict-Transport-Security":"max-age=31536000","X-FRAME-OPTIONS":"SAMEORIGIN","MicrosoftSharePointTeamServices":"16.0.0.20015","X-Content-Type-Options":"nosniff","X-MS-InvokeApp":"1; RequireReadOnly","X-MSEdge-Ref":"Ref A: 7F390B1313E548EDAAC1EB158A30BB9D Ref B: BN3EDGE0707 Ref C: 2020-04-28T22:53:29Z","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","Cache-Control":"max-age=0, private","Date":"Tue, 28 Apr 2020 22:53:29 GMT","P3P":"CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"","X-AspNet-Version":"4.0.30319","X-Powered-By":"ASP.NET","Content-Disposition":"attachment","Content-Type":"application/pdf","Expires":"Mon, 13 Apr 2020 22:53:29 GMT","Last-Modified":"Tue, 28 Apr 2020 22:53:29 GMT","Content-Length":"3349222"},"body":{"$content-type":"application/pdf","$content":"JVBE...Cg==}}

    where the ellipses at the end represent roughly 1.8MM random characters.

     

    Then the variable output looks like this...

     

    {"name":"Files","value":{"fileName":"redactedpkg.pdf","fileContent":"JVBE...Cg==}}

     

    So, if nothing else, it appears to be passing one file, which should be enough to at least attach that.

  • tcaruso Profile Picture
    28 on at

    This is infuriating, because I already put together a whole reply regarding the outputs of the last run, and it doesn't seem to have posted. I'm not entirely sure how best to do this, but I'll repeat what I did a few minutes ago. (This goes right along with the day that I've had trying to get this to work.)

     

    I can see that it's stepping through the three files:

     

    Capture.JPG

     

    The file names are right and there are truly three of them. They have a person's name in the file name, so I'm not including them, so that I don't have to black that out on each of them.

     

    Next, we have...

     

    Capture2.JPG

     

    However, it does look different on the second and third files.  I don't know how to read this, but here's the second. I've removed the millions of random characters after "$content" and just replaced with ellipses...

     

    {"statusCode":200,"headers":{"Transfer-Encoding":"chunked","X-SharePointHealthScore":"1","X-MS-SPConnector":"1","X-SP-SERVERSTATE":"ReadOnly=0","DATASERVICEVERSION":"3.0","X-Download-Options":"noopen","SPClientServiceRequestDuration":"78","SPRequestGuid":"b5ef020d-5db4-41c7-98d9-5ba4425ceb58","request-id":"b5ef020d-5db4-41c7-98d9-5ba4425ceb58","MS-CV":"DQLvtbRdx0GY2VukQlzrWA.0","Strict-Transport-Security":"max-age=31536000","X-FRAME-OPTIONS":"SAMEORIGIN","MicrosoftSharePointTeamServices":"16.0.0.20015","X-Content-Type-Options":"nosniff","X-MS-InvokeApp":"1; RequireReadOnly","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","Cache-Control":"max-age=0, private","Date":"Tue, 28 Apr 2020 22:53:27 GMT","P3P":"CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"","X-AspNet-Version":"4.0.30319","X-Powered-By":"ASP.NET","Content-Disposition":"attachment","Content-Type":"application/pdf","Expires":"Mon, 13 Apr 2020 22:53:28 GMT","Last-Modified":"Tue, 28 Apr 2020 22:53:28 GMT","Content-Length":"589673"},"body":{"$content-type":"application/pdf","$content":"JVB...DQo="}}

     

    And, then, the variable inputs:

     

    {"name":"Files","value":{"fileName":"blah.pdf","fileContent":"JVB...DQo="}}

  • rebeccas Profile Picture
    2,591 on at

    I use the attachments more than get file but I think you need to change in your Append to array variable where it says "fileContent" to "contentBytes"

     

    I usually put in a compose, click on the fields and see what it says when I hover of it and then delete the compose after I have it to figure out which it is. 

  • tcaruso Profile Picture
    28 on at

    Thank you for the suggestion. I tried replacing "fileContent" with "contentBytes" (are those case-sensitive?), but got the same result -- an email message with no file attachment. Was there a corresponding change that I was supposed to make on the other side of the colon?

     

    If you have a minute to explain the compose thing in a little more detail, I'd appreciate it. I tried putting that in there after the append, but not really sure what to look for.

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @tcaruso 

    Please post a screen shot of your entire Flow and I'll assist.  The more detail the better.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard