cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Multi attachment email - Error

Hi, 

I tried following this Flow: https://preview.flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

And also had a look at a couple of other discussions in this forum. 

Yet, when I try to replicate things, I get an error saying that 

{
"status": 400,
  "message": "Parameter 'Attachment Content' cannot be null or empty.\r\nclientRequestId: 2960f4c2-d0ff-439d-ab24-2baa52760795",
  "source": "office365-we.azconn-we.p.azurewebsites.net"
}
 
Attached are the files that I stored on a SharePoint document library and that I want to add all as attachment.
The files are XML and PDF documents.
f1.png
 
 
My flow looks as follows:
 
f2.pngf3.png
 
 
I even put an additional compose step before sending the email just to check that the content is not empty.
 
What is going wrong here?
Any help would be appreciated.
 
Many thanks,
 
Ludwig
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @lreinhard7 

 

have you used ContentByte or ContentBytes

 

the s is required

 

next try using expression  

 

"ContentBytes": base64(filecontentdynamiccontent)

 

 

the bold part is expression

 

 

View solution in original post

16 REPLIES 16
ScottShearer
Super User III
Super User III

@lreinhard7 

In your append to variable array action, try removing the double quotes around the filename with extension.  Please let me know if that works for you.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hello Scott, 

Just tested that but still get the same 400 error message...

Best regards, 

Ludwig

yashag2255
Dual Super User II
Dual Super User II

Hey @lreinhard7 

 

In place of Content you should have ContentBytes. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

RezaDorrani
Dual Super User II
Dual Super User II

Hi @lreinhard7 

 

replace "Content" with "ContentBytes"

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

@lreinhard7 

The following worked for me:

ContentBytes.jpg

Change Content to ContentBytes.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi, 

Many thanks for the hint with the ContentByte term this kind of resolved one error. 

Yet, now I receive the error:

status": 400,
  "message": "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'.\r\nclientRequestId: 4b1e9ced-1d72-4232-856a-3bf7d8e95e36",
  "source": "office365-we.azconn-we.p.azurewebsites.net"
This is strange because I entered the to, subject and body fields...
Interesting 😞
Best regards,
Ludwig

Hi @lreinhard7 

 

have you used ContentByte or ContentBytes

 

the s is required

 

next try using expression  

 

"ContentBytes": base64(filecontentdynamiccontent)

 

 

the bold part is expression

 

 

View solution in original post

Hello RezaDorrani

That is amazing. The base64 expression did the job!Smiley Happy

Many thanks for that. 

Best regards, 

Ludwig

Hi, 

After making some changes to my flow to make it run fast I run into another issue where I need some help. 

The problem that I currently have is that either no attachment is created or that an attachment file is created that I cannot open. 

Here are some of the things I tested:

Option 1: No attachment created

Option1NothingAttached.png

Option 2: Same as Option 1

Option2NothingAttached.png

 

Option 3: Error message that the attachment name cannot be null

Option3_ErrorAttachmentNameCannotBeNullOrEmpty.png

 

Option 4: Error unable to read message or attachment

Option4_ErrorUnableToReadMessageOrAttachmentContent.png

 

 

Option 5: Attachment file created but it cannot be opened 

Option5_AttachmentCreatedButOnlyAsSingleFilethatCannotBeopened.png

 

 

Any help would be highly appreciated. 

 

Many thanks, 

Ludwig

 

 

 

 

 

 

 

 

 

Hey @lreinhard7 

 

You can refer to the below screenshot. You need to have the Name while creating the array itself. And do not create that again in the send email action

er4.PNG

The display name is because my attachments are from sharepoint. You can have the custom filename there and ensure you have the right extension along with that. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Did you ever figure out what caused this issue? I am getting the same error.

Not really.

After deleting things again and starting from scratch things sometimes work. ... 

in case it helps someone else

I was getting consistently the error No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'  when trying to attach multiple attachments to an email

The issue was resolved when I made sure that anywhere the append to string variable was called, 
the "contentbytes": "body('....')['$content']" and that solved the issue.

the workflow was then able to attach multiple attachments in the same email.

This assumes you are creating an array variable to put in the name and contentbytes info of each attachments as mentioned above

ofs
Helper I
Helper I

I just encountered the similar error but I fulfilled naming content parameter as "ContentBytes" correctly (You can see in the image below that the flow parsed the file info in the right way)

 

However I still got the following error:

"No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'.
clientRequestId: ######(hidden intentionally)#####"

 

Could you please advise hints or help fix for me? I'd appreciate it!

fig1.jpg

 

fig2.jpg

 

Self-replying for solution I found. I directly access $content in binary-encoded data as ContentBytes. It seems working.

A big thanks to you!

 

This was driving me crazy because my flow failed when appending content to a an array and I didn't understand why it was working on a switch case and not on others even when the code was exactly the same!

 

It's just a workaround but solves the issue.

 

TLDR; use the output expression related to the dynamic content instead of the dynamic content itself.

 

Cheers!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,732)