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 / PDF creation worked on...
Power Apps
Unanswered

PDF creation worked on Desktop but failed in mobile app

(0) ShareShare
ReportReport
Posted on by 181

Hi all, 

I am developing the power app that use to create pdf and send email.

My power app that has the checkboxes for the user select

Below is my code:

 

Office365Outlook.SendEmailV2(
"alan.tse@clp.com.hk" /*DataCardValue84.Text &";"*/,/// To
"New: CLPeS of PO:",// Subject
"Dear Sirs," &"<br> The LALG Site e-inspection Report is attached and pasted as below for your follow up." & "<br> Thank." &
"<br> Dear Contractor," & "<br> Please refer to the report and rectify the defect(s) and provide Photo(s) to us for update by 2 business days." &"<br>Thanks.",
{Attachments: Table(
{
Name: "submittedInspection.pdf",

ContentBytes: PDF(DataCard1, {Orientation: "Portrait", ExpandContainers: true})
}
)
}
);

 

It is worked on desktop but failed on mobile app.

If i do not tick the check box on the mobile app, it is successful to send email with PDF.

It will cause below error if i tick anyone check box on the mobile , i do not have idea, would anyone help?

AT_AlanTse123_0-1707106464091.jpeg

 

Thank you very much.

Categories:
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Hello, 

    Hope you're doing well

    Ensure that the PDF(DataCard1, {Orientation: "Portrait", ExpandContainers: true}) expression is correctly generating the PDF content. Verify that it is not returning null or an empty value. You can use a label or other control to display the result of this expression for debugging purposes.

     

    Add a check to handle the case where the attachment content is null or empty before attempting to send the email. You can use the If function to conditionally send the email only if the attachment content is valid.

     

     

    If(!IsBlank(PDF(DataCard1, {Orientation: "Portrait", ExpandContainers: true})),
     Office365Outlook.SendEmailV2(
     "alan.tse@clp.com.hk",
     "New: CLPeS of PO:",
     "Dear Sirs, ..." & "<br>Thanks.",
     {
     Attachments: Table(
     {
     Name: "submittedInspection.pdf",
     ContentBytes: PDF(DataCard1, {Orientation: "Portrait", ExpandContainers: true})
     }
     )
     }
     )
    )

     

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Also can you please let me know how youre showing these error popups?

  • AT_AlanTse123 Profile Picture
    181 on at

    I use the power app on the smartphone, then i select one of the check box and press the send button, these error popups were shown.

    If I select anyone check box, these error popups were shown.

     

    Thank you very much

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    The error states that the Attachment parameter in your code is returning null or blank.

     

  • AT_AlanTse123 Profile Picture
    181 on at

    May i know the attachment parameter is about for what?

    Checkbox? Addpicture control?

    Thank you

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard