cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yvonzim
Resolver I
Resolver I

email 2 types of attachments

Hi, 

 

I have asked this before but no sollution yet.

 

i have a flow which generates 2 types of attachements.

one made with Create and Get file content

one made with initialze variable and Append to array

 

Both works fine, i get attachements but i cant attach them both in 1 email.

 

2 types of attatchment, dont work2 types of attatchment, dont work

 

attachment2.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions

@Yvonzim 

 

 "Attachments": [
                {
                    "Name""@body('Create_ICS_File_DepartureRet')?['DisplayName']",
                    "ContentBytes""@{base64(body('Get_file_content_DeparturerRet'))}"
                },
                {
                    "Name""@body('Create_ICS_file_ArrivalOut')?['DisplayName']",
                    "ContentBytes""@{base64(body('Get_file_content_ArrivalOut'))}"
                },
                {@variables('attachmentArray')} 
            ],


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

v-alzhan-msft
Community Support
Community Support

Hi @Yvonzim ,

 

I have made a test on my side and couldn't find a way to add the attachments from the Array and the attachment item.

I'm afraid that the function is not supported in Microsoft flow currently.

I suggest that you could add all the attachment item to the attachmentArray variable firstly, and when all the attachments is append to the attachmentArray, send the email with the attachmentArray.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

12 REPLIES 12
ChristianAbata
Super User
Super User

@Yvonzim cloud you show me what do you have in attachment array?



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

@ChristianAbata

attachment_array.PNG

sepperate attachments work.

Or the file created with attachmentArray

Or the files created with Create command

attachment_create.PNG

 

But not both files in one email 😞

hi @Yvonzim  this is becouse the file content needs this squema

 

{
  "$content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  "$content": "UEsDBBQABgAIAAAAIQDi"
}

 

and you are sending just the Content-byte, and remenber that the Content-byte needs a Content-file 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

@ChristianAbata 

 

Aha, dont know if i fully understand how and where to fix but i because both commands give an output that works.

So there is a file for the "get action" and there is a file voor de "array action".

 

Where do i have to fix this? in the email attachment field or ?

 

 

@ChristianAbata 

 

This is how the peek code looks for Array variable:

 

{
    "inputs": {
        "name""attachmentArray",
        "value": {
            "Name""@items('Apply_to_each_2')?['DisplayName']",
            "ContentBytes""@body('Get_attachment_content')"
        }
    }
}

@Yvonzim  is weard I'm trying to replycate what you need but my attachment content is empy.. O.o Maeby is a temporary bug.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

@ChristianAbata 

Ok, maybe it is an json error, im not good in Json code;

this is how the peekcode in the email looks like: 

 

   "Attachments": [
                {
                    "Name""@body('Create_ICS_File_DepartureRet')?['DisplayName']",
                    "ContentBytes""@{base64(body('Get_file_content_DeparturerRet'))}"
                },
                {
                    "Name""@body('Create_ICS_file_ArrivalOut')?['DisplayName']",
                    "ContentBytes""@{base64(body('Get_file_content_ArrivalOut'))}"
                },
                "@variables('attachmentArray')"
            ],

@Yvonzim 

 

 "Attachments": [
                {
                    "Name""@body('Create_ICS_File_DepartureRet')?['DisplayName']",
                    "ContentBytes""@{base64(body('Get_file_content_DeparturerRet'))}"
                },
                {
                    "Name""@body('Create_ICS_file_ArrivalOut')?['DisplayName']",
                    "ContentBytes""@{base64(body('Get_file_content_ArrivalOut'))}"
                },
                {@variables('attachmentArray')} 
            ],


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

@ChristianAbata 

 

Nope, i cant get it work.

 

When i delete the array attachment, i get email with attachement

whhen i add the array attachement i get an email without any attachement and no error.

 

v-alzhan-msft
Community Support
Community Support

Hi @Yvonzim ,

 

I have made a test on my side and couldn't find a way to add the attachments from the Array and the attachment item.

I'm afraid that the function is not supported in Microsoft flow currently.

I suggest that you could add all the attachment item to the attachmentArray variable firstly, and when all the attachments is append to the attachmentArray, send the email with the attachmentArray.

 

Best regards,

Alice       

 

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

@v-alzhan-msft 

 

Thanks alot, no is also an answer 🙂

I think Add all the attachment item to the attachmentArray variable will be my new mission.

 

Yvon

@v-alzhan-msft 

 

Maybe i need to start a new post.

But i tried to insert both attachement files in one array but i cant get it work

 

Below the first attachment in the array, that works

 

 

attachement.PNG

But it it possible to add more output from previous steps in the first line?

And how does the value part look then in the array?

Below my guess that doens't work 🙂 (i did correct the first "[")

 

attachment2.PNG

 

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,501)