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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Email SharePoint list item with attachments

(0) ShareShare
ReportReport
Posted on by 10

Good morning,

I've read many examples and solutions to describe what I want to do (Email SharePoint list item with attachments), and I believe I am doing everything correctly, however I have two issues that don't seem to appear anywhere else.

 

First:  When I add the JSON to populate my 'attachArray', I am prompted to "Enter a valid json" until I add an extra comma or semicolon after the code.  This doesn't seem to affect anything, but it's definitely odd.

Jonathan_Murray_0-1631633715905.pngJonathan_Murray_1-1631633751315.png

Second, while my flow runs without error, and the output looks correct, the attachments never make it to the email.  I am currently testing with two small, simple text files.  Here is the flow step:

Jonathan_Murray_2-1631633994656.png

Here is the output:

Jonathan_Murray_3-1631634017190.png

The raw inputs:

 

{
 "host": {
 "connectionReferenceName": "shared_office365",
 "operationId": "SendEmailV2"
 },
 "parameters": {
 "emailMessage/To": "deleted@email;",
 "emailMessage/Subject": " Test... has been created or modified [TEST]",
 "emailMessage/Body": "<p>This is a test<br>\nTest Text One.txt, Test Text Two.txt, </p>",
 "emailMessage/Attachments": [
 "{ \n“Name”:Test Text One.txt,\n“ContentBytes”This is test text document one\n};",
 "{ \n“Name”:Test Text Two.txt,\n“ContentBytes”This is test text document two\n};"
 ],
 "emailMessage/Importance": "Normal"
 }
}

 

The downloaded OUTPUT:

{"statusCode":200,"headers":{"Pragma":"no-cache","x-ms-request-id":"b7291d4d-a003-2493-98df-8b57e3afe990","Strict-Transport-Security":"max-age=31536000; includeSubDomains","X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","Cache-Control":"no-store, no-cache","Set-Cookie":"ARRAffinity=59fce84ed840ff13733470e527d4d138afeb7dd6f97aa09a47d6bce8875b278b;Path=/;HttpOnly;Secure;Domain=office365-usdde.azconn-usdde.p.azurewebsites.us,ARRAffinitySameSite=59fce84ed840ff13733470e527d4d138afeb7dd6f97aa09a47d6bce8875b278b;Path=/;HttpOnly;SameSite=None;Secure;Domain=office365-usdde.azconn-usdde.p.azurewebsites.us","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"false","Date":"Tue, 14 Sep 2021 15:36:36 GMT","Content-Length":"0","Expires":"-1"}}

And here is the email received (without attachments...):

Jonathan_Murray_4-1631634088089.png

Thanks for reading... Suggestions?

I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,465 Super User 2025 Season 2 on at
    Re: Email SharePoint list item with attachments

    Hi Jonathan. Please check your append to array variable action as it seems to be missing the second colon character. The append to variable action should be similar to this:

    ekarim2020_0-1631657901524.png

    Ellis

  • Jonathan_Murray Profile Picture
    10 on at
    Re: Email SharePoint list item with attachments

    Excellent eye, sir; I made the correction first thing and gave it a test.  Unfortunately, it had no effect; the result remains unchanged.  I can see the attachment contents in the output from "Get attachment content", however the contents apparently do not get added to the array in "Append to array variable."

     

    I was hoping that correcting the missing colon would also resolve my need for extra punctuation at the end of the JSON, however that did not change, either.  I can't help but think they're related and will pursue that issue today.

     

    Thank you, and any more insight is welcomed.

  • Jonathan_Murray Profile Picture
    10 on at
    Re: Email SharePoint list item with attachments

    Update!  I have no idea what just happened, but I was playing with variables trying to figure out the "valid json" problem when I stripped it down to { }, saved, and added in one element at a time trying to find out what was prompting the error.  I got the entire json rebuilt, and it resolved without error.  And the function worked.

     

    Thanks to anyone who has read this and tried to think of a solution, and thank you Ellis, for pointing out my syntax error which led me to a solution!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard