cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Error when sending list item attachments array using "When item is modified" Flow template

 
 I'm using the Flow template "When existing list item is modified" (https://flow.microsoft.com/galleries/public/templates/3821506240744debadcd89c94690652d) with the action "Send an email from a shared mailbox" and trying to email list item attachments but getting an error using "Switch to input entire array" in the attachments section.
 
I get the error message:
"Parameter 'Attachment Name' cannot be null or empty."

It seems that it does not recognize the DisplayName from:
output array1.png

Which is then used in the attachments section:
output array2.png

I don't get this error when I use the Flow template "When an item is created"

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using "When item is modified" F

Hi

 

Actually, I was using this MS Ignite video  Deep dive: Advanced workflow automation with Microsoft Flow and it instructed (at the 55:35 minute) that the ContentBytes content should be wrapped/defined in base64(), i.e base64(body('Get_attachment_content')). This worked as expected with Flow "When item is created" but failed when using Flow "When item is modified" . I ended getting it to work using these instructions https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/, and specifically with one of the comments stating that ContentBytes should be defined this way: body('Get_attachment_content').$content  

 

View solution in original post

9 REPLIES 9
Highlighted
Community Support
Community Support

Re: Error when sending list item attachments array using "When item is modified" F

Hi @Anonymous,

 

First of all, the trigger-When existing list item is modified is actually “When an item is created or modified”.

Then the format of the data in Compose action doesn't seem right, Dynamic content doesn't need to be surrounded by quotes here.

If you want to get attachments from the list item and send it as attachments in the email, please refer to this blog:

https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

Or refer to a similar Thread to see if it helps:

https://powerusers.microsoft.com/t5/Building-Flows/Email-notification-flow-fails-when-attachments-are-added/m-p/163074

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using "When item is modified" F

Hi

 

Actually, I was using this MS Ignite video  Deep dive: Advanced workflow automation with Microsoft Flow and it instructed (at the 55:35 minute) that the ContentBytes content should be wrapped/defined in base64(), i.e base64(body('Get_attachment_content')). This worked as expected with Flow "When item is created" but failed when using Flow "When item is modified" . I ended getting it to work using these instructions https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/, and specifically with one of the comments stating that ContentBytes should be defined this way: body('Get_attachment_content').$content  

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using "When item is modified" F

You said it worked once, then failed?

Because if you base64() something, then edit the Flow (in any way) and save it, you will lose the base64() part of your expression. 

In between the successful run and the run that failed, did you open your Flow and then save it? Because that'll be why. 

 

Come to think of it, that's I bug I should report in a separate post.

Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using When item is modified

Wrapping in base64() worked for "When item is created" but failed for "When item is modified" (https://us.flow.microsoft.com/en-us/galleries/public/templates/3821506240744debadcd89c94690652d/when...)

Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using When item is modified

Yeah, I know that's what your saying.

 

But, I'm pointing out there's this bug you probably didn't know about. You may have percieved that to be what happened, but are you sure your base64() expression was still in place during the "when an item is modified" run?

 

Because in your screenshot - it's not.

Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using When item is modified

base64() went away in both when I would put the flow back in edit mode after saving the first time. But only "When item is modified" would fail.

Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using When item is modified

Items generally get created before they get modified. If you first created, and then modified some items, and lost the base64() expression somewhere in between, I can see how you would conclude that the error only occurs when an item is modified.

Highlighted
Anonymous
Not applicable

Re: Error when sending list item attachments array using When item is modified

The base64() expression got lost in both flows after saving them. Not sure why one template would work and not the other. In any case, it ended up working for both templates with body('Get_attachment_content').$content with no error telling me that Attachment Name is missing.

Highlighted
Community Support
Community Support

Re: Error when sending list item attachments array using When item is modified

Hi @Anonymous,

 

Yes, the main cause of the error in the similar Thread I provided is this, which has been solved.

 

Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Users online (5,709)