Word Template In Pega

0 views
Skip to first unread message

Aline Braunbeck

unread,
Aug 5, 2024, 8:12:55 AM8/5/24
to unbrachalep
EngincanYThe code you are referring to is outdated, it uses the old Word Merge engine. In Pega 8.6 it still works but it is not recommended because it uses MS Silverlight which is now deprecated. By the way, to insert the code you mention, you have to insert with the Quick Parts button of MS Word, then add the formula "pega:inser corr=CorrespondenceName".

@DeivitThe issue resolved when I placed pega reference outside of table in word document. I assume that pega refers to a table in document. So, embedding correspondence/section inside a table in word document isn't supported I guess.


@DeivitCorrespondence content is not embedded using that function. I was actually using that function and that's why I posted this question. Anyway, I will continue to embed a property although it doesn't fulfill the business requirement completely. I guess there is no other option.


Edit: I attached screenshots of my word template as well as the correspondence rule and the result. Note: when inserting the formula, it will appear blank empty in the document but it is actually there, just right click > toggle Field Code and it will appear.


There will be word templates uploaded to pega. The user should be able to open the word file/template within pega, when they open few fields for which we have the values in the system should be auto populated, for the other fields they should be able to fill the details manually, after its filled when the user clicks on submit or process, the file should be attached to the case or sent to another system.


When I open the url returned by the function, word doc is downloaded. I see the word document is correctly generated but property references are not populated.

I tried to test it as follows;

pega:reference .pyNote




With Power Apps you can take the data entered into a form and use it to create PDF. This feature is not available out-of-the-box but I can show you how to build it. To do this we will build a basic form in Power Apps. Then we will design a Word document template and use Power Automate to fill and convert it to PDF. From there you either store the PDF in a SharePoint document library or sent in as an email attachment. In this article I will reveal the simplest way to generate a PDF form in Power Apps.






When the restaurant inspection form is completed the staff member presses the submit button and the results are posted to the Inspections SharePoint list. Submission of a new inspection form triggers the creation of a PDF form.






Next we will create a Word document template. The Word document will be filled in with information from the Power Apps form and converted to a PDF by Power Automate. Open Microsoft Word and begin a new document (.docx). Include a title for each form field and then write some placeholder text below each title.






The Word document must be saved to a SharePoint document library or OneDrive to be used by Power Automate. In this tutorial we will save it to OneDrive. Open OneDrive and drag-and-drop the Word document into the root folder.










Add a Populate a Microsoft Word Template action and point it to the Restaurant Inspection Template word document we stored in OneDrive. Fill-in the Word document with information from the newly created record.










The Question 1, 2 and 3 fields have the data type Yes/No in SharePoint but they will display the values true or false in our Word document by default. We must write a Power Automate expression to change the values to yes or no instead. Write these expressions in the Question 1, 2 and 3 fields respectively.






If you have any questions about Easiest Way To Generate PDFs In Power Apps (No HTML) please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.


Great post Mathew, thanks!!! I did something like this using Excel with two Sheets. One hidden for loading data from Power Apps and other with a template where cells are referenced to that data. It works without premium connector and can be converted to PDF also.


Hi Aydar, you need an Excel file with two sheets stored in SharePoint. One hidden to load data with Power Automate (sheet1) and other (sheet2) with a formulated template referencing the data of sheet1. I will attach 2 pictures to show how it works.


Have you found any alternative to Word documents you like better? I know the Plumsail connector is very good. But that has a monthly cost with the vendor on top of the premium Power Automate connector.


I do have a question though and that is if it would be possible to create a form, that has three sections, user one completes section A presses submit which sends the form to a user who completes Section B and then on to User C who then presses a final button which then outputs, this way, to a PDF.


As per Evan, this is exactly what I need to do for our company. I need to create a standard Inspection form that needs to be filled out on an ipad by at least 2 operatives during a manufacture stage, then a final sign off by a supervisor for completion. Each form would then have to be named per the Panel unit number, Example; A12345-123. All forms to be saved to the cloud for any inspector to view when needed. At times, they may have to add a photo or drawing to the pdf (just to complicate things). Any help would be most grateful.


Hey Mathew you are amazing can do you one app using power apps which contains two or three questions and attachments and pen input control. All these data should be saved in SharePoint and after that by using power automate to get pdf all the details including attachment images and pen input signature to pdf. Please help me I got stuck in this one. Could you please share your email?


I would respectfully suggest that you could add a comment or two stating that if you are saving to a Sharepoint Site then the Path statement will not work and you have to manually add the path followed by the Name variable.


The new PDF() function feature is currently Experimental. I would not recommend launching an app with Experimental features turned on into production. Microsoft is still working out the bugs on this one and functionality could change.


Unfortunately, this method is premium only. I like this method the most but there are some free alternatives. #1. Generate HTML and use Power Automate to convert to PDF file type. #2 Use the Experimental PDF Function() which can be enabled in advanced settings.


Thank you matthew! I got my flow up and running, I added a step of making the created PDF an attachment to the list item. I would love to add one more step and send that attachment in outlook email as an attachment but i cant seem to get it quote right. any suggestions?

3a8082e126
Reply all
Reply to author
Forward
0 new messages