Send Form Data as PDF via Email is a crucial requirement in many Power Apps solutions. As a Power Apps developer, you can create apps for various business needs. For instance, you develop a Power App where employees update their personal and bank details, while HR uses it to view this information. To maintain records, HR needs employee details in PDF format and wants an efficient way to convert and email the data. In this blog, you’ll learn how to generate and send form data as a PDF in Power Apps. 

Why to Covert Form Data into PDF 

In numerous organizations, obtaining data via forms is a standard procedure for tasks such as creating invoices, gathering feedback, or keeping records. Nonetheless, providing this data to clients, team members, or external stakeholders often necessitates that it be in a widely recognized format, like PDF. Converting form data into PDFs by hand is tedious, susceptible to mistakes, and lacks uniformity. Moreover, guaranteeing that the PDF adheres to a consistent format while maintaining data precision poses a difficulty in the absence of an automated system. 

Connector for Sending Email

To send emails from Power Apps, you must utilize a connector that creates a link between the Email Provider and Power Apps. For this purpose, we will use a connector supported by Power Apps, specifically the Office365Outlook connector. 

Incorporate Connector into Power Apps 

Incorporate Connector into Power Apps 

Look for the Connector Office365 Outlook connector 

Look for the Connector Office365 Outlook connector in Power Apps
Choose an email ID to link Power Apps

The connector will be Added 

The connector will be Added in power apps

Next, capture a screen that has a container, and insert a Gallery control and a Form within the container on the screen. Ensure to set the data source for both the Gallery control and the Form control. 

In this blog, we are presenting the EmployeeData source. 

EmployeeData source

Code to Send an Email

Write a code to send an email which contains a PDF file. PDF file contains form data. 

Code to Send an Email IN PDF form with power apps

In the code above, the PDF function is utilized to transform Container data into a PDF format. 

The PDF Power FX function within Power Apps generates a PDF document of container control. Inside this container, there is a form control that is showing data. 

Since the PDF function is an experimental feature, it’s turned off by default. To use it in your apps, you need to turn it on manually. 

Conclusion 

Using the PDF function in Power app one can make PDF and send as an email attachment and download the PDF. One thing to keep in mind is the PDF function will only convert data which is there on container.  

Leave a Reply

Your email address will not be published. Required fields are marked *