1. Help Center
  2. Formatting the results

How to map data to output a PDF

A guide to correctly mapping data to your PDF output.

Once you have finished creating all of your Panels, Fields, Data Bindings and have added your PDF to the SmartForm Outputs panel, you are ready to begin mapping your Output PDF.

Where to Map your Output PDF

You will be able to map your PDF(s) in the same panel that you used to add an output, the Documents Panel.  

  1. Click on  DOCUMENTS in the horizontal menu bar across  the top of FormHero Studio. 
  2. Scroll to the PDF you wish to map, and click on the text to open the PDF mapping preview.  
  3. On the right side of the PDF Mapping preview under PAGE # DATA MAPPINGS, you should see all the fillable fields listed.  When you click into a field, there will be the option to select a Mapping Type, User Response Key, Default Value, and Formatters. There will be a default mapping type assigned to each field based on how the PDF was created.  

Once the desired fields are mapped in the PDF, click Apply and ensure that the Destinations in the Submission panel has been updated to render the PDFs.

 

To determine which mapping type to use, see the Mapping Type section.

User Response Key should be the data binding name, or a constant value that you would to use.  The format of the user response key might change based on the mapping type.

The Default value is what you would like the response to be if there is no data mapped.  The field will usually be left blank, but you can choose to enter a value that will be returned if the data binding is undefined.

Formatters can be added to mapped fields to format the value of user responses.  A date value format can be updated to just be MMM/YYYY, or you can choose to make a short text field value to be capitalized. 

 

Mapping Types

There are five different mapping types, depending on the field type (e.g. checkbox, multi-check, short text) you will see all or some of them.  To change your mapping types, simply select the dropdown and select one of the types provided.

By default, most fields will be set as a “Simple Mapping” mapping type. 

 

Mapping Type: Simple

Simple mapping will print the direct value of the data binding provided, and will likely be the most common form of mapping you will use.  

In the user response key, you will choose the data binding name that has the value you would like to populate into the field.  

Note: if you have created any data bindings using the Behaviors tab and the data binding name is not added to the start panel, the data binding name will not show up in the user response key list.  You can choose to add these types of data bindings to the start panel to use simple mapping, or you can use the Template mapping type.

Use Cases - Field Types: Short Text Fields, Date Fields, Long Text fields

Note: Any fields that are collected as an array (e.g. Multi-check, Tiered Selector) cannot be used as a simple mapping and can cause an error in rendering the PDFs.

User Input

PDF Output

User Input - empty string

PDF Output

Mapping Type: None

When the mapping type is set to “None”, you will not be able to set any data binding to that field mapping.  When the output is rendered as a PDF, the field will be blank.

User Input

PDF Output

Mapping Type: Constant

A Constant Mapping type will return the value that is provided to the PDF output. In the below example, the string of “Value” will always print to the PDF, regardless of the value that the user inputs.  

Use Case Examples: We recommend using Constant Mapping for information that the form user does not need to interact with. (E.g. Company contact number or address.)

User Input

PDF Output

Mapping Type: Mapped-Value

The Mapped-Value field allows you to create a list of values to check against the value of the data binding that is provided.  If the data binding equals any of the “user-entered values” provided in the list, the value returned will be the corresponding “value to assign to PDF”.  You may also set a default value in the event that the user does not submit any of the values provided on the list. If no default value has been declared and the value does not match any item on the list, the returned output will be an empty string.

Use Case Examples: Checkbox Fields, Multi-check fields.  In the PDF output, these fields are usually checkboxes or radio buttons.

User Input - matched value

PDF Output

User Input - does not match a value

PDF Output

Mapping Type: Template

Template mapping uses Handlebar templating, and allows you to combine a string with one or more data bindings in a single output.  

As mentioned earlier, any data bindings created in the Behaviors tab in the form will not show up in simple mapping, so you can use Template Mapping to render the value in the PDF.

Use Case Examples: 

First and Last name fields - {{name.first}} {{name.last}}

Adding currency types = {{amount.paid}} - GBP

 

 

User Input

PDF Output

Note: using two curly bracers “{{ }}” will register unicode strings.  If you do not want unicode to be included, use triple curly bracers “{{{ }}}” to wrap your databindings.

 

User Input

PDF Output