web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to email a collect...
Power Apps
Answered

How to email a collection as attachments?

(0) ShareShare
ReportReport
Posted on by

Hi, I am trying to email some collections as an output of powerapps. In the attachment option, what do I need to specify in the ContentBytes and odata.type fields, if my collection is already a table?  I have seen ways to convert collections of photos and other files into table, but not sure what type I need to specify if it is already a table. 

 

I have got the error message: 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you want to send an emial that contains a table?

    1)send a table by using html text

    Try this formula:

    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 red part with your data.

    Here's my test for your reference:7263.PNG

    7264_LI.jpg

    7265.PNG

    Here's a similar issue for your reference:

    https://powerusers.microsoft.com/t5/Expressions-and-Formulas/Data-Table-to-Email-in-PowerApps/td-p/182115

    2)convert a table to an image, send an email with attachment

    Try this formula:

    Office365.SendEmail(inputTo.Text, inputSubject.Text, inputBody.Text, {Attachments:Table({Name:"file1.jpg", ContentBytes:filevalue, '@odata.type':""})})

    Here's a similar issue for your reference:

    https://powerusers.microsoft.com/t5/General-Discussion/Email-with-attachment/m-p/239607

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard