cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bri
Advocate III
Advocate III

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

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

Meneghino
Community Champion
Community Champion

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

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.

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!!

Meneghino
Community Champion
Community Champion

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

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!

Meneghino
Community Champion
Community Champion

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

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

 

Thanks!!

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,464)