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

@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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,950)