LA: Sending email containing one or multiple attachments from a SPO listitem: issues with the array

Jurgen Verhelst 331 Reputation points
2021-01-05T06:03:06.187+00:00

Hi Guys

We have a SPO list that can hold 1 or more attachments. At some point the information in the listitem and all attachments of that listitem needs to be sent via email.

I could not get the more than one attachment sent and found this article how-to-send-listitem-attachments-as-email-attachment-from-flow

I followed his steps but in testing the email does not get sent. Could you guys check if this is still the way to do it in 2021 in LA. the article is a bit older and for Flows, not LA

the error I get states I did not specify a to: and subject, but both are specified. When I remove the attachments the email gets through. So I assume I am doing something wrong with the attachments array

{  
  "status": 400,  
  "message": "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'.\r\nclientRequestId: ece54e11-b0cf-47e5-b449-b3b2b1bbe9a9",  
  "error": {  
    "message": "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'."  
  },  
  "source": "office365-ne.azconn-ne-01.p.azurewebsites.net"  
}  

Not in the screenshot as it has to be in the top and not in a condition, there is an inittialize Array called Attachments Array step.
In the Append to array step, the first variable Contentbytes is the Body:(Get_Attachment_Content) from the step above it
the Name variable comes from the for each step Items(for each)?[displayname]

53464-schermafbeelding-2021-01-05-055223.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,543 questions
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Jurgen Verhelst 331 Reputation points
    2021-01-06T05:58:15.327+00:00

    Hi Allen,

    It seems to be a known issue!

    In march Prakash Maitani posted a video explaining the steps and the error: watch

    You need to alter the "Append to array Variable" action to find the content pointing it to the variable $Content as in the screenshot below. Then it does send one email containing all attachments of the listitem.

    53880-screenshot-2021-01-06-065329.png

    Thanks!

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Allen Xu_MSFT 13,861 Reputation points
    2021-01-05T10:12:05.25+00:00

    Hi @Jurgen Verhelst ,

    I could reproduce your issue in my end. We can use dynamic content 'attachment content' instead of using the array variable.

    Please refer to my flow:
    53586-2-1.png

    Details:
    53558-2-2.png

    53559-2-3.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Jurgen Verhelst 331 Reputation points
    2021-01-06T05:11:11.563+00:00

    Hi Allen,

    I tried that but it sends 2 emails. I need it to be 1 email with all attachments

    any idea how?

    0 comments No comments

  3. Allen Xu_MSFT 13,861 Reputation points
    2021-01-06T06:35:33.68+00:00

    @Jurgen Verhelst

    Thanks for your response :-)

    I followed the steps in this article: Advanced | Flow of the Week: Send multiple attachments on a single email, it works in my environment without any error, multiple attachments can also be included in an email.
    53951-image.png
    53776-image.png

    Comparing my flow with yours, the only difference I found is the order of "Name" and "ContentBytes". Mine is as below:
    53813-image.png

    If I change the order of them, my flow will fail and get error:
    53795-image.png

    So, try to change the order the them in your flow. If the error still persists, recreate a new flow under the instruction of the above article.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.