PDF Creator- Using Summary variable

Now that you have seen how to use a PDF creator with the text variables and the image variables let us consider situations where a summary report is needed in a pdf format. You can make use of the Summary control on the form and generate the PDF based on that data using the PDF template. You can add Summary variables in your PDF Creator template. Then it is as simple as linking the summary variable in the PDF Task and generating the PDF from your workflow.

The PDF Creator basically involves two steps, create custom templates based on existing templates or design your own template on a blank template. Once this template is ready you can use it within the workflow to generate or create the PDF using dynamic values.

Let us consider a simple scenario to create a summary of Candidate details which would be generated as a candidate data sheet.

Let us add the template first. Under Studio Console, click PDF Creator and click + (Add) template. There are some ready templates that you can Preview and Use.

Here in this example, you can create your new template from a blank page. To create your own template from the Blank page, click Blank and enter the Name for your custom template and click Add Template.

If you have selected a ready template you would find that there are different components like text, titles, tables, images and variables already added to the template. You can customize these if you want as per your application.

If you have added a blank template, you would simply get a blank page. You can add the different containers and components to organize your page.

Adding components

To start with, note that the template page has a single + (Add) button at the bottom of the page that allows you to add a new page. Within this page, you can add the other components like Title, Text, Heading 1, Heading 2, Table, and so on. You can use these to design your page as needed.

Adding variables

Now when you are designing a template, the main consideration is to use it with your applications. You would typically need data from the Form or screen or even from the sheets. To be able to fetch the data and add it to your template, you need to use the variables. In this example let us see how to use the Summary variable.

To add variables to the template as required, under Variables, click the Add button which gives you the option to choose a text variable, photo variable, summary variables, list variable(text) and list variable (image). You can use these variables in the template by simply adding double curly brackets and adding the variable from the list. Click Summary variables and add a variable NewVar.

Now for this example, we want to generate a summary of details. We would be thus adding the Summary component to the page. Click the + (add) button and select the Summary component.

The summary component which is a tabular representation gets added to your page.

Now the important part is to set the properties for this control. Select the control and click Summary settings. In this format for the summary control, the first column provides the values for the input controls and the second column are the values that are the responses from the end-users.

Now select the Variable that you had created earlier NewVar. You can toggle on Show Subsequent tables in new Pages to enable subsequent tables. The output is in the form of tables for each page that your data is fetched from. They are arranged one after the other starting from the page where the summary control is added. Now if you set it ON, then the responses from each page are displayed on a separate page. In other words, responses from every new form start from a new page. Normally, they are displayed one after another. You can also customize and personalize the screen name, the table header, and the table section by changing the font color, background color, and the table headings for Question label and Answer Label. The data appears as a question and response in this table. So you can make the changes as per your application.

Once your template is ready you can Save it. The template needs to be published before it can be used in your workflows. So, click Publish and add an appropriate release note.

Now let us see how the PDF creator generates the PDF dynamically.

Let us consider a few scenarios. In the first scenario, we will just add a summary control to the form to which we would be adding the PDF creation workflow. Consider that you have multiple forms to add candidate details. The first form contains the candidate name and qualification. You navigate from this form to the next form which will accept the experience details. From this form, you would navigate to the next form which would provide a summary of both the forms. A summary control is added that displays the details. On submitting this form you want to generate a summary in PDF format, the template for which we have already created earlier.

Now let us also consider another scenario before we link the workflow. You can add a form repeat control to add multiple data for the same. In the above example, we will simply add a form multi-row control in the qualifications details and a form repeat control for Experience details. It is important to note that the summary control would not display the data from the form multi-row control. It is recommended that you use a Form repeat control instead of a Form Multi-row control. However, it would be displayed in the Summary report that we generate as a PDF.

Create a workflow that you would link to your screen and select the task Generate PDF and add a self-explanatory Task Name. Under Template to use, select your Template name. You can also set the custom name for the PDF generated and can also encrypt the PDF by using Set User Password. Toggle on to set the password.

It is now necessary to configure the variables by using the data option to fetch the appropriate values. In both scenarios, you need to use the summary control to link to the summary variables in the template. So, select the appropriate control using the Data option under Tasks > Initiated. So here you would be passing the summary control’s values to the summary variable.

Click Done and your task is ready.

To use the PDF generated, you can use another task like an email task to send the PDF generated to the specified user as an attachment. Provide the task name and select the user to send an email to. Enter the subject and email body. Now we want to add the file as an attachment. It can be accessed through the data option as the .PDFLINK, where the workflow name is the name of the Generate PDF task created earlier. Click Done. Now the workflow is ready.

Let us take a preview of the forms and the pdf created in both the scenarios.

1. Using only summary control

2. Using form repeat and form multi-row with summary control

Now, whenever you submit your form for candidate details you can now see the PDF Created based on the template. It has all the values submitted from the three forms.

You can thus use the PDF creator in this way to design your own summary templates and use them as per your application demands.