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

is there an easy way to email a collection?

I'm working on an internal request app. As the user finds what they need, they add the product to a collection. The collection is displayed on the checkout screen. I'd like to email the collection in the body of an email to the user and another associate to take action. I've tried a few things but I'm still hung up. Is emailing a collection in the body of an email this challenging?

 

 

 

 

7 REPLIES 7
Highlighted
Super User
Super User

Re: is there an easy way to email a collection?

@BKICK 

You can email the collection in the body of the email as an HTML table.

 

I've made a free app to teach people how to use collections including your scenario.  Suggest you download the app and give it a try.  How to create an HTML table is in the final section called "Exporting Collections"

 

Link to Collections Cookbook:

https://powerusers.microsoft.com/t5/Community-App-Samples/Collections-Cookbook-50-Visual-Examples-am...

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Community Support
Community Support

Re: is there an easy way to email a collection?

Hi @BKICK ,

Do you want to email with a collection as table format?

If so, I suggest you convert the collection to html text, then send email with the html text. The html text will display as table format in your email body.

So the key point is how to write the html text.

I've made a similar test for your reference:

1)the formula about sending email:

Office365.SendEmail(
     "email address",
     "subject",
     HtmlText1.HtmlText,
    {
     IsHtml:true
    }
)

2)set HtmlText1's HtmlText:

 "<h3>tablename</h3>" &
     "<strong> Items: </strong>" &
     "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
     "<tr style='background-color:#efefef'>
      <th>fieldname1</th> <th> fieldname2 </th> <th> fieldname3 </th>
     </tr>
     <tr>" &
    Concat(collectioname,
       "<td>" & fieldname1 & " </td>
        <td>" & fieldname2 & " </td>
        <td>" & fieldname3 & " </td>","</tr><tr>") &
    "</table>"

//please replace with your collection name and field names.

my collection:3319.PNG

 So I use this htmltext:

 "<h3>collectio1</h3>" &
     "<strong> Items: </strong>" &
     "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
     "<tr style='background-color:#efefef'>
      <th>test1</th> <th> test2 </th> <th> test3 </th>
     </tr>
     <tr>" &
    Concat(collectio1,
       "<td>" & test1 & " </td>
        <td>" & test2 & " </td>
        <td>" & test3 & " </td>","</tr><tr>") &
    "</table>"

 

Then you will get an email with table format.

If you want to combine them together, you could use this formula to send email directly:

Office365.SendEmail(
     "email address",
     "subject",
     "<h3>tablename</h3>" &
     "<strong> Items: </strong>" &
     "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
     "<tr style='background-color:#efefef'>
      <th>fieldname1</th> <th> fieldname2 </th> <th> fieldname3 </th>
     </tr>
     <tr>" &
    Concat('The data source/formula that you provided within the Items property of your Data Table control',
       "<td>" & fieldname1 & " </td>
        <td>" & fieldname2 & " </td>
        <td>" & fieldname3 & " </td>","</tr><tr>") &
    "</table>",
    {
     IsHtml:true
    }
)

 

Here's a similar issue for your reference:
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-email-a-collection-as-attachments/td-...

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: is there an easy way to email a collection?

@v-yutliu-msft 

 

Am I missing something? The error message is "Invocation of unknown or unsupported function."

 

Office365.SendEmail(
"brian.kick@wolseleyind.com",
"TEST EMAIL",
"<h3>PrinterOrder</h3>" &
"<strong> Items: </strong>" &
"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th>Branch_Number</th> <th>Printer_shipping_address</th> <th>Requester</th>
</tr>
<tr>" &
Concat(PrinterOrder,
"<td>" & Branch_Number & " </td>
<td>" & Printer_shipping_address & " </td>
<td>" & Requester & " </td>","</tr><tr>") &
"</table>",
{
IsHtml:true
}
)

Highlighted
Helper I
Helper I

Re: is there an easy way to email a collection?

@mdevaney 

 

The cookbook seems awesome. It's a little over my head but I gave it a shot. The error message is "The function 'First' has some invalid arguments."

 

Office365.SendEmail("brian.kick@wolseleyind.com","TEST EMAIL", ClearCollect(myHTML,{htmlString:"<table>
<tr>
<th>Branch_Number</th>
<th>Printer_shipping_address</th>
<th>Requester</th>
</tr>"});
ForAll(
PrinterOrder,
Patch(
myHTML,
First(myHTML),
{htmlString: First(myHTML).htmlString&"
<tr>
<td>"&Branch_Number&"</td>
<td>"&Printer_shipping_address&"</td>
<td>"&Requester&"</td>
</tr>"})
);
Patch(myHTML,First(myHTML),{htmlString: First(myHTML).htmlString&"
</table>"});
Set(PrinterOrder,First(myHTML).htmlString)

Highlighted
Community Support
Community Support

Re: is there an easy way to email a collection?

Hi @BKICK ,

Have you connect with Office365 outlook successfully?

42.PNG

 

After you connect with Office365 outlook successfully, try this formula:

 

Office365Outlook.SendEmailV2(
"brian.kick@wolseleyind.com",
"TEST EMAIL", 
"<h3>PrinterOrder</h3>" &
"<strong> Items: </strong>" &
"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th>Branch_Number</th> <th>Printer_shipping_address</th> <th>Requester</th>
</tr>
<tr>" &
Concat(PrinterOrder,
"<td>" & Branch_Number & " </td>
<td>" & Printer_shipping_address & " </td>
<td>" & Requester & " </td>","</tr><tr>") &
"</table>",
{
IsHtml:true
}
)

The function should be : Office365Outlook.SendEmailV2().

Office365.SendEmail() is the old function that has been deprecated. I'm sorry that I forgot to tell you.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: is there an easy way to email a collection?

@v-yutliu-msft 

 

New error says "No parameter. This function has no optional parameter named "IsHtml"." 

Highlighted
Community Support
Community Support

Re: is there an easy way to email a collection?

Hi @BKICK ,

Try this function:Office365Outlook.SendEmail().

 

Office365Outlook.SendEmail(
"brian.kick@wolseleyind.com",
"TEST EMAIL", 
"<h3>PrinterOrder</h3>" &
"<strong> Items: </strong>" &
"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th>Branch_Number</th> <th>Printer_shipping_address</th> <th>Requester</th>
</tr>
<tr>" &
Concat(PrinterOrder,
"<td>" & Branch_Number & " </td>
<td>" & Printer_shipping_address & " </td>
<td>" & Requester & " </td>","</tr><tr>") &
"</table>",
{
IsHtml:true
}
)

I found that only in :Office365Outlook.SendEmail(), there's parameter of Is HTML.

 

 

Here's a doc about this connector, please notice the Send an email (V2) action and Send an email action.

https://docs.microsoft.com/en-us/connectors/office365/#send-an-email-(v2)

 

 

Best regards, 

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

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 (7,483)