Advice and answers from the Device Magic Team

To customize the PDF or Word file during your Destination set-up, first select the Destination location (in the example below, that is email).  Next, click on either the PDF or DOCX file format.

Once you select the PDF or DOCX format, navigate down to Step 5 and click the link for "Show Options".

After you click "Show Options", you will see the screen below.  Click on the green "Download a sample template" button to download the Word file template which you can use to customize your output.

By creating and uploading your own template, you will be able to make the layout of your submitted form match your original form more closely or the ability to create a completely new format.  This sample template provides you with all the placeholders.  These placeholders dictate where the form fields map in the document once the form has been submitted.

Once the file has downloaded and opened, it will look something like this:

As you scroll through it, you will see the different placeholders available (everything in double curly brackets, including the double curly brackets is a placeholder).

At this point, open a new Word document. In the new Word document, you can set up the form with the headers and footers you'd like to use, and any branding you want included.

Next, you can go on to add the questions to the document in any order you like and copy and paste the placeholders wherever you would like the answers to appear (questions and answers can also be put in tables - you just need to design the table as usual, and put the placeholders where you want the answers to go).

Note: In the event that a question is not answered, the placeholder will be replaced with a blank space.

Font, Size and Color:

If you would like the questions and answers to appear in a particular font, size or color, all you need to do is highlight the questions and placeholders and change the font, size and color. When the form comes through, the answers that have replaced the placeholder will be in the same font, size and color as the placeholder.

Images:

Images added to the form can be resized using size specifications in the placeholder. For example, if your image question placeholder is "#{{ fields.image_question }}", and you want the image to appear in 400x200 you can ensure the image arrives at the destination in the size you desire by adding "|400x200" to the end of the placeholder. It will look something like this: #{{ fields.image_question|400x200 }}.

Decimal/Integer Questions:

Decimal and integer question placeholders can be edited by adding "|currency" at the end of the placeholder, before the closing brackets. This will make the decimal and integer answers come through with two spaces after the decimal. For example, if the answer is 23.23246, the adjusted placeholder will make the answer come through as 23.23.

Multi-Select Questions:

When a select question has the "Allow Multiple Answers" box checked, and multiple options are selected in the form, the answers come through all on the same line, separated by commas. This can now be adjusted so the answers come through on separate lines, by adding "|each_answer_on_new_line" at the end of the placeholder, before the closing brackets.

Location Questions:

Maps can now be resized using size specifications in the placeholder, much the same as the Image question. So, for example, if your location question placeholder is "#{{ fields.location_question }}", and you want the map to appear in 100x100, you can ensure it arrives in that size by adding the size restriction at the end of the placeholder so the placeholder looks like this: #{{ fields.location_question |100x100 }}.

Map images can now be set to link to Google Maps. Simply set up the placeholder with the following at the end, before the closing brackets: "|hyperlink: true".

Lastly, location questions can now have their coordinate information's visibility disabled. This can be set by adding "| show_coordinate_info: false" at the end of the placeholder, before the closing brackets. The placeholder will look something like this: #{{ fields.location_question |show_coordinate_info :false }}.

Subforms:

When it comes to subforms, you will see the main subform heading among the available placeholders, as well as each of the subform's question's placeholders. You can choose to either have the subform altogether, and use the subform heading placeholder, or you can choose to separate the questions (perhaps include some, but not others, or place them separately in the template), and use the individual placeholders.

Repeat Groups:

Repeat group answers are automatically generated in table format. There is, however, the formatting option "|list", which allows you to list the answers in the group, instead.

Another way you can format your repeat groups is by filtering the questions that you choose to display (this works with the default display as well as the list layout).

The basic way to structure the repeat group placeholder is as follows:

filter_fields: [question_1, question_2]

Sub-groups in repeat groups can be filtered as well by adding the sub section when specifying the fields you want included:

For example, [field1, field2: [subfield1, subfield2], field3]

The placeholder should look something like this:

#{{ fields.Group | list, filter_fields: [Question1, Question2: [SubQuestion2_1, SubQuestion2_2], Question3] }}

Lastly, if you filter image and location questions, you can resize the images and maps (the same as mentioned above). For example, your image question's placeholder will look something like this: #{{ fields.Group | list, image_size: 300x100 }}, whereas your location question's placeholder will look something like this: #{{ fields.Group | list, map_size: 300x100 }} .

Note: New formatting options are only available if you enable the new beta templating. This can be done by checking the box next to where it says "Use new template method". 

Once you're done with designing your Word template, save it and upload it to the Destinations page (by clicking on the "Upload my Word .DOCX template" button).

Additional

Customization

You can also customize your template by adding a background, logo or adding your company letterhead information if you like. In addition to that, you can also place the data as you please, in which ever order that would work for you.

The most important thing to remember is that as long as the placeholders are on the template, the data will populate on submission.

This concludes our overview of custom templates for Word/PDF destinations. If you have any questions or comments feel free to send us a message at support@devicemagic.com or leave us a comment below.

Did this answer your question?