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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Converting Screen to P...
Power Apps
Answered

Converting Screen to PDF and send as email

(1) ShareShare
ReportReport
Posted on by 36
Hi all , 

As mentioned in the title, I'm trying to convert a page screen to PDF and send it as an email. However, I'm receiving the following error and am not sure how to fix it:

Invalid argument type (Record). Expecting a Text value instead.
 
This is my Onselect code for the PDF icon:
 
Office365Outlook.SendEmailV2(
    User().Email,
    "FORM K",
    {
        Attachments:  
            {
            Name: "Sample.pdf",
            ContentBytes: PDF(Screen2_2)
            }
        
    }
);
Notify("PDF Sent via MAIL")
This is the screen if it helps.
 
 
 
Categories:
I have the same question (0)
  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at
     
    You're hitting that classic Power Apps argument type mismatch because SendEmailV2 expects a text string as the email body, but you're passing an object instead. Plus, the Attachments property must be a table, not a single record.
     
    Office365Outlook.SendEmailV2(
      User().Email,                // Recipient
      "FORM K",                    // Subject
      "Please find attached Form K.", // Body must be text
      {
        Attachments: Table(
          {
            Name: "Sample.pdf",
            ContentBytes: PDF(Screen2_2)
          }
        )
      }
    );
    Notify("PDF Sent via MAIL")
     
    Thanks!
     
    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.
     
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    Firstly what @Rajkumar_M has posted is correct and will work. I would just like to clarify that your problem was that you were missing the Body parameter - Table() also works, but you do not need it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard