cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Station1901
Helper III
Helper III

Email / Printing

Hello,

I have a gallery which works as it should and filters out the multiple pieces of information I need but............ I Know printing from Powerapps can be a bit difficult so I was wondering is there is anyway I can press a button on my powerapp and the results from my gallery can be emailed to a pre-set email address?

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Station1901 ,

Do you want to use data in a gallery as email body?

If so, the key point is how to write the email body  by using html text. (Use html text to represent the data in the gallery.)

Firstly, save the data in the gallery as a collection.

ClearCollect(collection1,gallery1.AllItems)

Secondly, send a table by using html text:

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><th> fieldname4 </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
    }
)

Please replace the tablename,data source, field names in your issue.

 

 

Here's a similar issue in details 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.

View solution in original post

3 REPLIES 3
eka24
Super User
Super User

Watch this video from Shane Young:

https://youtu.be/bF7WkqtxKB0

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Thanks for this.  The email side is what I am looking for but my Gallery shows multiple results and I'd like the email to contain all of these results not just single textboxes.

Hi @Station1901 ,

Do you want to use data in a gallery as email body?

If so, the key point is how to write the email body  by using html text. (Use html text to represent the data in the gallery.)

Firstly, save the data in the gallery as a collection.

ClearCollect(collection1,gallery1.AllItems)

Secondly, send a table by using html text:

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><th> fieldname4 </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
    }
)

Please replace the tablename,data source, field names in your issue.

 

 

Here's a similar issue in details 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.

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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