– PDF Generator App is used by companies to generate pdf & download them from PowerApps. Once the user filled in his/her details he/she can generate a pdf and download it.
First set up the Word Template.
First, you need to enable the developer option in word
The Developer tab isn’t displayed by default, but you can add it to the ribbon.
After you show the tab, the Developer tab stays visible, unless you clear the check box or have to reinstall a Microsoft Office program. Now Go to PowerApps.
Now we will create the custom list in SharePoint and add the columns i.e.
Fields:
Now we will use that SharePoint list in PowerApps.
Now add the SharePoint Data source as shown in the below screenshot.
After adding the data source we will add that created custom list.
Now, Make the SharePoint Document Library.
Add columns in the SharePoint library same as the SharePoint list columns.
Now add the word file to SharePoint Document Library.
Now open that word file, in the insert tab go to quick parts.
In quick parts go to document property.
Here you can see all created columns in the SharePoint library will display here.
Now we will add controls one by one.
Here we have added the developer control i.e. plain text content control.
To change the property of the control go to the developer tab and in controls click on properties.
Now change the properties of the content control as below screenshot.
Now we will hide the control.
Just click on the control and go to the home tab and click on font settings.
Checkmark on the hidden option in effects.
Do this same for all other controls.
This way, if the value is unavailable, the control will be shown as blank.
Now our template is ready and clicks save.
After a move that word template to a different SharePoint Document Library.
– To Create Flow go to Power Automate, the n templates tab of Power Automate search for the r PowerApps button, and select t PowerApps button template by Microsoft.
Name the flow to Generate PDF and delete the trigger and add PowerApps (V2) in its place.
Add the Input in PowerApps (V2) trigger.
Now add the get item action.
Add that created input in PowerApps trigger call it in get item action in id column.
Now add the get file content action to get the created word template file content.
Add action called to create a file
From the get file content action, we will create the file in the SharePoint document library.
Now add update file properties action.
From this action, we will update the created file properties i.e. first name, last name, etc.
Now add get file content using the path.
From this action, we will get that updated file’s full path and create it in One Drive.
Now add Create file (One Drive) action.
From this action, we will create a file in one drive from the SharePoint library file.
Now add the Convert file (One Drive) action.
From this action, we will convert that created word file in (One Drive) to pdf.
Now add the action Create file (SharePoint).
From this action, we will create that pdf file from One Drive to SharePoint Document Library.
Now we will get the created pdf file path by adding the compose and respond to a PowerApps or flow.
From this action, it gives the file link and from that link, we will download that file using PowerApps.
We are now done creating the flow to Generate PDF.
– Go back to power apps and add the Download PDF button, then go to the action tab, select power automate, and add the Generate PDF flow. Now flow will be added to our app.
Now add the below code in the Download PDF button on select property.
Download(GeneratePDF.Run(gLastSubmit.ID).linkoutput);
Note: The data shown in the screenshot is for demonstration purposes only.
We love to hear from you about your project.
Note: Give us a call or leave a message, we endeavour to answer all enquiries within 24 hours on business days.
If you want to get a free consultation without any obligations, fill in the form below and we’ll get in touch with you.