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

Email a collection

So i have a browse gallery with checkboxes on each item, if an item gets checked, it gets added to a collection. I want to be able to email this collection to the user when they are finished selecting items.

 

Is this possible?!

 

If not, anyone know some good work arounds?!

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Email a collection

Hi @Bri

 

The process I use is the following:

 

1) Create four standard text boxes (not HTML boxes) for the four parts of the HTML content:

TextBoxHtml_1: HTML header and table header row

TextBoxHtml_2: Table itself with data from the collection

TextBoxHtml_3: Totals row

TextBoxHtml_4: HTML footer

 

2) Preview the result in a an HTML text box, by setting its HtmlText property to this:

Concatenate(TextBoxHtml_1.Text, TextBoxHtml_2.Text, TextBoxHtml_3.Text, TextBoxHtml_4.Text)

3) Send the email with a button by setting its OnSelect property to this (you will need Flow for this):

SendEmailHTML.Run(TextInputEmail.Text, "Visura "&DropdownVeicolo.Selected.Value,
	Concatenate(TextBoxHtml_1.Text, TextBoxHtml_2.Text, TextBoxHtml_3.Text, TextBoxHtml_4.Text),
	"AAA","","XXX@YYY.com")

Please let me know how you get on.

 

Here are the four text boxes' Text property in order.  The second uses the Concat function on the collection.

 

"<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {border: 1px solid black;}
</style>
</head>
<body>

<body style='font-family:arial;' >

<p style='font-weight:bold'>Visura sintetica al "& TextBoxUltimaData.Text &" per "& DropdownVeicolo.Selected.Veicolo &"</p>
<p style='font-weight:bold'>"& DropdownStrumento.Selected.InstrumentName &"</p>

<table style='width:100%'>
  <tr>
    <th>Nominativo</th>
    <th style='width:5em'>VAM ID</th>
    <th style='width:8em'>Versato, EUR</th>
    <th style='width:8em'>Quote/azioni</th>
    <th style='width:6em'>Percentuale</th>
  </tr>
  "
Concat(CachedTransactions,    "<tr>
    <td>"& Nominativo &"</td>
    <td style='text-align:center'>PER"&Text(Holder, "[$-en-GB]0000")&"</td>
    <td style='text-align:right'>"&Text( -Sum(AllRows, Amount )  , "[$-en-GB]#,##0.00")&"</td>
    <td style='text-align:right'>"&ConsuntivoPersona&"</td>
    <td style='text-align:right'>"&PercPerson&"</td>
  </tr>
  ")
If(Value(TextBoxConsuntivoAltri.Text)<>0,
  "<tr>
    <td colspan='2' style='color:red' >Altri non identificati</td>
    <td style='color:red; text-align:right'>"& Text( Sum(CachedTransactions, Amount )  , "[$-en-GB]#,##0.00")&"</td>
    <td style='color:red; text-align:right'>"&TextBoxConsuntivoAltri.Text&"</td>
    <td style='color:red; text-align:right'>"&TextBoxConsuntivoAltriPct.Text&"</td>
  </tr>
  ")
"<tr>
    <td colspan='2' style='font-weight:bold'>Totale</td>
    <td style='text-align:right; font-weight:bold'>"& Text(Sum(Filter( CachedTransactions, Holder = DropdownVeicolo.Selected.Issuer  ), Amount), "[$-en-GB]#,##0.00") &"</td>
    <td style='text-align:right; font-weight:bold'>"& TextBoxConsuntivo100pct.Text &"</td>
    <td style='text-align:right; font-weight:bold'>"& TextBoxConsuntivo100pctPct.Text &"</td>
  </tr>
</table>

</body>
</html>"

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Email a collection

The Concat function does exactly that, it loops through every row of your collection.

See here: https://powerapps.microsoft.com/en-us/tutorials/function-concatenate/

 

Be careful, there is a difference between Concat and Concatenate, you need Concat to loop through the rows.

View solution in original post

7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: Email a collection

Hi, yes it's possible, but only as an HTML table in the body of the email.  You create the email text with the Concatenate function, after filtering for the checked items.

I think I have a post on this, please ping back if you do not find anything.

Highlighted
Advocate II
Advocate II

Re: Email a collection

Do you mind showing how you create the email with the concatinate function? I have tried all sorts of methods doing this, but cant seem to get it to work!!

 

Appreciate the help, the powerapps team/ community is great!!

Highlighted
Community Champion
Community Champion

Re: Email a collection

Hi @Bri

 

The process I use is the following:

 

1) Create four standard text boxes (not HTML boxes) for the four parts of the HTML content:

TextBoxHtml_1: HTML header and table header row

TextBoxHtml_2: Table itself with data from the collection

TextBoxHtml_3: Totals row

TextBoxHtml_4: HTML footer

 

2) Preview the result in a an HTML text box, by setting its HtmlText property to this:

Concatenate(TextBoxHtml_1.Text, TextBoxHtml_2.Text, TextBoxHtml_3.Text, TextBoxHtml_4.Text)

3) Send the email with a button by setting its OnSelect property to this (you will need Flow for this):

SendEmailHTML.Run(TextInputEmail.Text, "Visura "&DropdownVeicolo.Selected.Value,
	Concatenate(TextBoxHtml_1.Text, TextBoxHtml_2.Text, TextBoxHtml_3.Text, TextBoxHtml_4.Text),
	"AAA","","XXX@YYY.com")

Please let me know how you get on.

 

Here are the four text boxes' Text property in order.  The second uses the Concat function on the collection.

 

"<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {border: 1px solid black;}
</style>
</head>
<body>

<body style='font-family:arial;' >

<p style='font-weight:bold'>Visura sintetica al "& TextBoxUltimaData.Text &" per "& DropdownVeicolo.Selected.Veicolo &"</p>
<p style='font-weight:bold'>"& DropdownStrumento.Selected.InstrumentName &"</p>

<table style='width:100%'>
  <tr>
    <th>Nominativo</th>
    <th style='width:5em'>VAM ID</th>
    <th style='width:8em'>Versato, EUR</th>
    <th style='width:8em'>Quote/azioni</th>
    <th style='width:6em'>Percentuale</th>
  </tr>
  "
Concat(CachedTransactions,    "<tr>
    <td>"& Nominativo &"</td>
    <td style='text-align:center'>PER"&Text(Holder, "[$-en-GB]0000")&"</td>
    <td style='text-align:right'>"&Text( -Sum(AllRows, Amount )  , "[$-en-GB]#,##0.00")&"</td>
    <td style='text-align:right'>"&ConsuntivoPersona&"</td>
    <td style='text-align:right'>"&PercPerson&"</td>
  </tr>
  ")
If(Value(TextBoxConsuntivoAltri.Text)<>0,
  "<tr>
    <td colspan='2' style='color:red' >Altri non identificati</td>
    <td style='color:red; text-align:right'>"& Text( Sum(CachedTransactions, Amount )  , "[$-en-GB]#,##0.00")&"</td>
    <td style='color:red; text-align:right'>"&TextBoxConsuntivoAltri.Text&"</td>
    <td style='color:red; text-align:right'>"&TextBoxConsuntivoAltriPct.Text&"</td>
  </tr>
  ")
"<tr>
    <td colspan='2' style='font-weight:bold'>Totale</td>
    <td style='text-align:right; font-weight:bold'>"& Text(Sum(Filter( CachedTransactions, Holder = DropdownVeicolo.Selected.Issuer  ), Amount), "[$-en-GB]#,##0.00") &"</td>
    <td style='text-align:right; font-weight:bold'>"& TextBoxConsuntivo100pct.Text &"</td>
    <td style='text-align:right; font-weight:bold'>"& TextBoxConsuntivo100pctPct.Text &"</td>
  </tr>
</table>

</body>
</html>"

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Email a collection

I really appreciate that extended response, I get what the concatination function does, but what i do not understand is how i am going to loop through each row in my collection, and add it to the html text, so i can send all rows in the collection in one email.

 

Do you get what i mean? I want to essentially send the whole collection in one email!! Like im printing a reciept!

Highlighted
Community Champion
Community Champion

Re: Email a collection

The Concat function does exactly that, it loops through every row of your collection.

See here: https://powerapps.microsoft.com/en-us/tutorials/function-concatenate/

 

Be careful, there is a difference between Concat and Concatenate, you need Concat to loop through the rows.

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Email a collection

Ooooohhh really?! thats awesome, i will give it a shot a little later. Will accept as solution if i get it to work!!!!

 

Thanks!!

Highlighted
Helper III
Helper III

Re: Email a collection

Hi @Meneghino,

 

I saw your posting about emailing a collection in powerapps.  I saw your solution that you are sending it to flow first.  Is there a reason you are sending it to flow instead of just emailing it from powerapps with the Office365.SendEmail() function?  Thanks.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,158)