Merge Keys
Last updated
Last updated
PDF Template Merge Keys are individual components used to include dynamic or programmatic data into your PDF - they are generally child records of your HTML to PDF Merge Template or Label Template.
Merge Keys are referenced in the parent PDF Template by placing the 'Merge key' value in ${handlebar} brackets.
For example, if you have a Merge Key with a 'Merge key' value of 'FIRST_NAME', you can insert it into your PDF Template by adding ${FIRST_NAME} to the 'HTML template' field of your PDF Template.
In most cases, you will create new PDF Template Merge Key records from the Related List on the HTML to PDF Merge Template or Label Template form. This ensures they are properly linked to the parent Template.
Depending on the type of PDF Template Merge Key you create, you will find different options on the form.
Source table: Table from which to derive the record attribute. (Note: This is pre-set to the 'Source table' on your parent Template and cannot be changed. If you need to reference a different table, use a 'Scripted' Merge Key.)
Source field: The field from which to derive the record attribute. Depending on the field type, you may choose a Value type specific to that field, such as Value, Display Value, Currency String, etc.
Static text: Static text to display. This type of Merge Key can be useful when reusing a static piece of text in multiple PDF locations, but you wish to edit it in a single location.
HTML text: Similar to 'Static', but with rich-text capabilities.
Barcode generator: When Yansa's Barcode & QR Code Generator app is installed on the same instance, this option is available to embed a Barcode Label into your PDF.
When using a barcode label within a PDF Template, we recommend creating a Barcode Generator with a single Barcode Part that is the barcode or QR code component, and then using PDF Generator to add any additional content.
Pre Defined Map: Merge Map records can be predefined via the Yansa PDF Generator -> Merge Maps -> Pre-Defined Merge Maps module in the left nav. This can be useful to create a Merge Map once and then reuse it in multiple PDF Templates. Pre-Defined Maps can be of any type: Source Record Attribute, Static, HTML, QR/Barcode, or Scripted.
Script: Server-side script allowing you to return any custom content you desire. The source table record ('current') is available. This can be useful to reference dynamic data that is related to the source table record, but unavailable on the source table record itself. This can also be useful to include dynamic data such as date/time content that needs to be generated at the time the PDF is created.