Mapping Fields in Templates
5 minutes to readMapping fields to a PDF file in document generation allows for automated, personalized documents by inserting data into predefined areas in the uploaded PDF files. This ensures consistency, accuracy, and efficiency, while enabling reusability for high-volume document generation.
Steps to map a template with fields in your tables:
- From the Document templates list, edit the template where you want to map fields.
- Click the Mapping tab to start mapping
- In the Data source field, select the table or the view whose fields you want to use. If the chosen table has related tables defined through relationships, you can include these related tables in the next step.
- Optional: In Related tables, you can include one or more related tables to use their fields for mapping.
- Click the Edit icon to open Related tables panel.
- In the Tables section, click Add to select one or more related tables you want to use for mapping.
- Choose the appropriate relationship for the selected related table.
- In the Sort By section, click Add to include fields for sorting the returned records used in the mapping process. Sorting controls the order of records from related tables, making it easier to reference and map the correct data in the generated PDF document.
- Click Apply to save your selection.
- Once you have selected the data sources, you can start mapping fields for the uploaded PDF.
- Click on the Click to map link for any field on the right panel, or
- Click any field in the PDF file to open the mapping field panel.
- In the Mapping type dropdown,
- Select Custom value to combine multiple data source fields or parameters and map them to a single field in the template.
- Select Data source field to map a single data source field directly to a corresponding field in the template.
- If you select the Custom Value option, click the Insert Parameter link to add one or more system parameters or data source fields, or you can manually enter them. If the custom value field is left empty, the generated PDF will display the field name placeholder, such as [@field:Screen_No].
- If you select the Data source field, the following options are available for mapping:
- From the Data source field dropdown, choose a field to be mapped with the corresponding field in the document template.
Note: Password fields cannot be mapped. For Dropdown fields that accept values outside the allowed list, you can enter any value.
- If related tables are included in the mapping, enter which records will be used for mapping in the Record index.
Note: If you enter a value that is higher than the number of returned records, the PDF document field will be empty.
- If related tables are not included in mapping, select Use display value if you want to use Display Value of the related table defined in relationship settings.
This option appears only if you have configured enabled display value in Relationship or the related tables are not included in the mapping. - For Checkbox fields, define the condition under which the checkbox will be selected in the generated PDF by using the Checkbox selected if value.
- Optionally, you can truncate the mapped value by specifying the character length range in the Use character from and to.
- From the Data source field dropdown, choose a field to be mapped with the corresponding field in the document template.
- You can also apply custom format or styles the mapping value. Click Edit icon to open formatting and styling panel.
- On the Data display tab, configure the display format and regional settings for text, numeric, currency, date/time, and yes/no values in your PDF document. You can choose from predefined formats or define a custom format.
Note: For Listbox, Dropdown, and Radio button fields, ensure that the values from the data source match the format of the corresponding values in the template.
- On the Data display tab, configure the display format and regional settings for text, numeric, currency, date/time, and yes/no values in your PDF document. You can choose from predefined formats or define a custom format.
- On Text styling tab, you can also apply styles to the mapping value by customizing font settings, alignment and background color.
Note: Data display settings are applied upon PDF generation. If a user edits a value on a generated PDF, the source PDF data display settings are applied (and not data display settings from a template).
- On Text styling tab, you can also apply styles to the mapping value by customizing font settings, alignment and background color.
- Optional: In the Default value, you can specify a default value if the mapping field value is empty, not mapped or not in the list of values.
- For a Text field, specify a default value.
- For a Checkbox field, define whether it should be selected or cleared by default.
- For Radio buttons, Dropdowns, or Listboxes, choose a default option from the available values.
- For Dropdown fields that allow custom entries, either input a default value or select from the existing options.
- In the Editing after PDF generation dropdown, specify whether you want to make the field editable in the generated PDF document.
- Never allowed – field value is not editable
- Always allowed – the field value can be editable
- Allow if field is empty – the field value can be editable if it is empty.
- Click Next field to map another field or Save to confirm your changes to the template.