cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

attach more than one collection as attachments by emal

Hi All:

 

I am dealing with next problem, I need to attach 2 differents collections with the email conector, but I cant figure out how to attach more than one, I try using the symbol "+" as you can see below but no luck, can give an idea how to do this?

 

collections.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: attach more than one collection as attachments by emal

Hi @felipito1 ,

I will try to give you the benefit of how I have tackled this issue, however it is different to your approach mainly as a result of where the images are when I need to action them.
I am fairly sure that the the issue with what you are trying to do is that the Outlook connector at the other end cannot interpret and decode your collection and work out it is multiple attachments, however I have never used the connector for this purpose.
I will give you two scenarios that may be relevant and I can share more of the details if they are useful to you.
Firstly, emailing pictures in a SharePoint Library via a Flow. A SharePoint gallery contains these records and the file identifier is known, so it is a matter of getting the content and using that for the email attachment. It probably would be a bit more complex with all of the other things you are doing with the email.
The second involves embedding images in a PDF file and sending this as an attachment to an email, again via a Flow.Currently, I get these from a SharePoint library, however they are put there via a Flow, so it should not be hard to use the same logic to divert them to email attachments.
Please let me know if you want information on any of these.

View solution in original post

Highlighted
Helper II
Helper II

Re: attach more than one collection as attachments by emal

@WarrenBelz I am happy to tell you that I find the solution. What I have done was with 2 diferents buttons one for collect the attachments and a diferent one for collect the pictures inserted both of them under a same collection name, obiously I have to respect the columns that the attachments requiered. 

 

"Value","ContentBytes","@odata.type",""

 

Then in the screen of the email body I use a button for call the email funtion and in the attachment argument I just call to the collection created.

 

So problem fix! I wake up this morning with this idea on my head and the first thing on my day was test it and work at the very first time. It is not awsome?

 

Cheers and regards from Chile!

 

View solution in original post

10 REPLIES 10
Highlighted
Community Champion
Community Champion

Re: attach more than one collection as attachments by emal

Hi @felipito1 ,

Do the collections have the same field names?

If so ClearCollect(Collection3, Collection1, Collection2)

 

Then you can send one collection (Collection3).

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Helper II
Helper II

Re: attach more than one collection as attachments by emal

No 😕 they actually dont have same fields. Is any way to attach these 2 collections?

Highlighted
Helper II
Helper II

Re: attach more than one collection as attachments by emal

any suggestion? I been trying looking all day for the solution but no luck ;(

Community Champion
Community Champion

Re: attach more than one collection as attachments by emal

Hi @felipito1 ,

I am in a different time zone (Australia), so have just got  back to this.

I can now see what you are using them for (Attachments) I could not zoom in on the photo on the device when I answered the first time.

What data are you sending in these (are they a file that already exists in a data source somewhere)?

 

Highlighted
Helper II
Helper II

Re: attach more than one collection as attachments by emal

Good day, and thank you for you time and help. @WarrenBelz 

 

I will try to explain what is happening. I am building this app for generate reports and send its by email. The first screens are for data collection (I have some textImput labels for collect this info) in one of these screens I have a PowerApps Attachment Control to send email attachments, in the next screen I have an "add picture control" where I insert 1 or 2 pictures that I include on the body of my email report. In the last screen I have the email body composed in “HTML TEXT’’  and this is filled by the textImput labels information inlucled 1 or 2 pictures embedded (same ones that I insert in the last screen) for embedded images on the email body I have guided by your reference post that you gave on other post https://powerusers.microsoft.com/t5/Building-Power-Apps/send-image-via-email/td-p/103464)

 

So what is the problem: for embedded images on the email body I need to save the images to a collection:

 

Collect( ImageCollection,
  {Name: YourName.jpg", ContentBytes: YourImageControl.Image, '@odata.type':""})

 

for include the images on the email body I must attach this collection created using the code on email button  :

 

Office365.SendEmail(
    User().Email,                                       <! the email is sent to whomever is loggin into the app>
    "Report Name",                                      <! name of the email, the subject>
    emailtext.HtmlText,                                 <! the content of the email, the body, I wrote it in html>
    {Attachments: ImageCollection, IsHtml:true})        <! attach your ImageCollection>

 

 

All is good until there but as I mentioned I also have an PowerApps Attachment Control for attach some files that are on the phone and I need to include on the report, as you may know for use this control I need to use the next code on the email button:

 

Office365.SendEmail(
    User().Email,                 <! the email is sent to whomever is loggin into the app>
    "Report Name",                <! name of the email, the subject>
    emailtext.HtmlText,           <! the content of the email, the body, I wrote it in html>   

{Attachments:AddColumns(RenameColumns(botonadjuntos.Attachments,"Value","ContentBytes"),"@odata.type","")  <! attach the files on the attachement control>

 

 

As you can see for the SECTION attachments I have 2 codes that I need to use, the first for attach the collection with body pictures and a diferent code for attach the files on my attachment control.

 

What Can I do? how can tell to the button that I have 2 codes for the section attachments?

 

I really aprecciate your help!!

 

Cheers.

Highlighted
Helper II
Helper II

Re: attach more than one collection as attachments by emal

Good day, and thank you for you time and help. @WarrenBelz 

 

I will try to explain what is happening. I am building this app for generate reports and send its by email. The first screens are for data collection (I have some textImput labels for collect this info) in one of these screens I have a PowerApps Attachment Control to send email attachments, in the next screen I have an "add picture control" where I insert 2 pictures that I include on the body of my email report. In the last screen I have the email body composed in “HTML TEXT’’  and this is filled by the textImput label information and the 2 pictures that I insert in the last screen (for embedded images on the email body I have guided by your reference post that you gave on other post https://powerusers.microsoft.com/t5/Building-Power-Apps/send-image-via-email/td-p/103464)

So what is the problem: for embedded images on the email body I have to need to save the images a collection:

Collect( ImageCollection,
  {Name: YourName.jpg", ContentBytes: YourImageControl.Image, '@odata.type':""})

an then use this argument on attachement for the email button:

Office365.SendEmail(
    User().Email,                                       <! the email is sent to whomever is loggin into the app>
    "Report Name",                                      <! name of the email, the subject>
    emailtext.HtmlText,                                 <! the content of the email, the body, I wrote it in html>
    {Attachments: ImageCollection, IsHtml:true})        <! attach your ImageCollection>

 

But as I mention I am using a attachment control for attach files from my phone. for that I need to use this code on the attachment argument:

 

{Attachments:AddColumns(RenameColumns(botonadjuntos.Attachments,"Value","ContentBytes"),"@odata.type","")

 

 

So the question is how can we tell to the email button that we have 2 codes on the attachment argument?

 

thank you!!

 

I hope this post dont dissapear.

Highlighted
Community Champion
Community Champion

Re: attach more than one collection as attachments by emal

Hi @felipito1 ,

I will try to give you the benefit of how I have tackled this issue, however it is different to your approach mainly as a result of where the images are when I need to action them.
I am fairly sure that the the issue with what you are trying to do is that the Outlook connector at the other end cannot interpret and decode your collection and work out it is multiple attachments, however I have never used the connector for this purpose.
I will give you two scenarios that may be relevant and I can share more of the details if they are useful to you.
Firstly, emailing pictures in a SharePoint Library via a Flow. A SharePoint gallery contains these records and the file identifier is known, so it is a matter of getting the content and using that for the email attachment. It probably would be a bit more complex with all of the other things you are doing with the email.
The second involves embedding images in a PDF file and sending this as an attachment to an email, again via a Flow.Currently, I get these from a SharePoint library, however they are put there via a Flow, so it should not be hard to use the same logic to divert them to email attachments.
Please let me know if you want information on any of these.

View solution in original post

Highlighted
Helper II
Helper II

Re: attach more than one collection as attachments by emal

Unfortunately, my company Microsoft license does not own SharePoint.
Well I just want to mention I have to attach the pictures only because is the only way for embed images to the HTML body of the email. If I dont attach the pictures then I am not able to see these on the email.

Highlighted
Community Champion
Community Champion

Re: attach more than one collection as attachments by emal

Do you own Flow?
I have a bit of testing to do but I may be able to change one of mine to do an email..I am also going to consult one of my colleagues on this.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,650)