How to: Generate a PDF from an HTML template

Through the Lookups we are able to store and use HTML templates to generate a PDF using form fields.


Create a Lookup to store the HTML templates

  1. Navigate to the Shared Lookups
    Modules (top left) → Module Name → Shared Lookups (tab)

  2. Select the ‘+Add’ button in the top right.

  3. Name the new Shared Lookup 'HTML Templates'.

  4. From the right mounted palette add a Long Text field.

  5. Select the Wrench icon to open the field properties enable the 'Is HTML' checkbox

  6. Save the Lookup form and close the Lookup form editor.

  7. Add the HTML formatted template into the field configured to support HTML templates.


Create an attachment field

  1. Navigate to the Field List.
    Modules (top left) → Module Name → Forms (tab) → Field List

  2. Select 'Add Field' in the top right.

  3. Enter an descriptive Internal Name, System Name, and select ‘Attachment' for the type.
    Such as: 'PDFAttachment’

  4. Save the Field List.

Generate the attachment from the Workflow

  1. Navigate to the Shared Lookups
    Modules (top left) → Module Name → Workflow (tab) → Workflow Name

  2. Select the Action which will generate the PDF Attachment.

  3. Select the Subactions tab.

  4. Add a ‘New Section’, followed by selecting the menu icon to the right.

  5. Within this menu select 'Generate attachment'.

  6. Set the Template to be used on the left, and the Attachment field to store it on the right.

  7. When the Action is performed the PDF will be generated and stored in the Attachment field.


Accessing the attachment from the form:
Adding the Attachment field to the Default Form will allow the Attachment to accessible on the form and viewed when generated.


To include the attachment in an Email:
In the email template add %(extendedfieldPDFAttachment)%
Replace the value accordingly if your attachment field internal name varies