cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yvonzim
Helper III
Helper III

2 different attachments in one array possible?

I have 2 types of attachments

1 an attachment in een sharepoint list i put in an array (that works)

2 attachements i generate in the flow with create file option (that works)

Sending both in one email is not an option (not working).

https://powerusers.microsoft.com/t5/Building-Flows/email-2-types-of-attachments/m-p/518102#M66082

 

How do i put them both in one array to sent as an attachment in an email?

 

attach.PNG

 

{
"Name": @{items('Apply_to_each_2_SP_list_attachment')?['DisplayName']},
"ContentBytes": @{body('Get_attachment_content')}
}

2 ACCEPTED SOLUTIONS

Accepted Solutions

 

Hi @Yvonzim ,

 

You need to add attachments in the list to the array variable first.

The get the fill content of created files and append them to the array variable with the same data format.

Finally, configure the array variable to Attachments field of Send email action.

Image reference:

13.PNG14.PNG15.PNG16.PNG

Please take a try.

 

Best Regards,

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.

View solution in original post

@v-bacao-msft 

 

it works!

 

After all those weeks, i made it work thanks to the add to Array tip from you and the @base64 function 

see: http://disq.us/p/1zqg1zt

View solution in original post

14 REPLIES 14
v-bacao-msft
Community Support
Community Support

 

Hi @Yvonzim ,

 

Do you want to send a single email with multiple attachments?

If so, please check this blog and see if it helps:

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

Feel free to let us know if you have any questions.

 

Best Regards,

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.

Hi @v-bacao-msft 

 

Thanx for the link, i did follow that post and it works great for the attachment in de sharepoint list

It also works for the file attachments created in the flow, 

But both together in an email is nog possible:

https://powerusers.microsoft.com/t5/Building-Flows/email-2-types-of-attachments/m-p/518102#M66082

 

What i want to try is to put both file types in one array, but how?

As you can see in the image it is not possible to add two output "places".

attach.PNG

 

 

Hi @Yvonzim ,

 

You need to add attachments in the list to the array variable first.

The get the fill content of created files and append them to the array variable with the same data format.

Finally, configure the array variable to Attachments field of Send email action.

Image reference:

13.PNG14.PNG15.PNG16.PNG

Please take a try.

 

Best Regards,

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.

View solution in original post

@v-bacao-msft 

 

I did try.

Same result. Separate files  (array) as an attachment works, but when i add a second array as attachment, email is empty. No error.

attach.PNG

Looks like this in peek code:

 

   "Attachments": [

                "@variables('ICSAttachment')",
                "@variables('attachmentArray')"
            ],

 

Hi @Yvonzim ,

 

You don’t understand my mean, we should append all files to a single array. We only need an array variable. Check my configuration again.

Or show me your configuration to check and remove the incorrect step.

 

Best Regards,

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.

@v-bacao-msft 

 

In the first place, thank you for your input and no i dont understand what jou mean 🙂

 

I will show you the complete flow.

Where step 1 - 2 gives an file output

Where step A - C gives an Array output (attachements from SP list)

 

flow steps.PNG

Here is step C:

flow step C.PNG

 

On what point do i merge those files together?

It did not manage to get all outoput merged in step C (append to array).

 

 

Hi @Yvonzim ,

 

Please carefully check the structure of the configuration I provided, in fact, it is almost the same as your structure, but I don’t have those Data operation controls, but this does not affect the final result.

 

Please put Initialize variable AttachmentArray in front of Create ICS file ArrivalOut action.

 

Then add Append array variable under Get file content ArrivalOut and Get file content DepartureRet respectively, and then add the file name and file content to the array variable.

 

So we only need one array variable and add all the files to the array variable that needs to be sent in the email.

 

Hope that makes sense.

 

Best Regards,

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.

@v-bacao-msft 

 

I sounded so hopeful.

I made the changes you said, and after the flow ran i could see all the files where stored in the AttachmentArray.

 

flow edit.PNG

 

No errors and but no attachments either 🙂

 

Is there a way to see what the AttachmentArray looks like in the end?

 

 

 

Hi @Yvonzim ,

 

Please show me the configuration of Send email action.

 

You could add a Compose above Send email action to output array variable.

 

And you could check each append to array variable action to if there are files added to the array.

 

Best Regards,

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.

Im so happy with your quick responses:


I made a Compose to see the AttachmentArray is filled; and it is filled with the right attachment info.

 

Is this what you mean with email config? (sorry im a newbie to flow)

 

email.PNG

But now the flow suddenly failed, see error:

 

{
"status": 400,
"message": "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'.\r\nclientRequestId: b9d910f4-d599-4cb2-b906-6ab8332e1994",
"error": {
"message": "No input parameters provided. Please provide required input parameters 'To', 'Subject' and 'Body'."
},
"source": "office365-ne.azconn-ne-01.p.azurewebsites.net"
}

 

I made a Compose to see the AttachmentArray is filled; and it is filled with the right attachment info.

 

 

 

 

Hi @Yvonzim ,

 

You could check the comments of the blog and you could get the method to solve this issue.

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

 

Best Regards,

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.

@v-bacao-msft 

 

Thanks for the link, that was my starting point.

That made my Sharepoint list attachements work.

But i will try again to understand if this also can solve my attachement problem with 2 different output files.

 

Thank you so much for your responses!

 

Yvon

 

Hi @Yvonzim ,

 

Please check this and you just need to apply to the body of Get file content and Get attachment content action:

40.PNG

 

Best Regards,

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.

@v-bacao-msft 

 

it works!

 

After all those weeks, i made it work thanks to the add to Array tip from you and the @base64 function 

see: http://disq.us/p/1zqg1zt

View solution in original post

Helpful resources

Announcements
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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (70,776)