cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Anonymous
Not applicable

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
Community Support
Community Support

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.
Anonymous
Not applicable

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

Anonymous
Not applicable

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.

Anonymous
Not applicable

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...)

Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (71,624)