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?
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:
---
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."
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:
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,
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
}
)
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)
Hi @BKICK ,
Have you connect with Office365 outlook successfully?
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,
New error says "No parameter. This function has no optional parameter named "IsHtml"."
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,
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
207 | |
193 | |
82 | |
58 | |
38 |
User | Count |
---|---|
303 | |
247 | |
119 | |
83 | |
55 |