Toggle menu

HTML Template (server-side)

This field lets you create a HTML template using Handlebars. The template can dynamically generate HTML by inserting the values of form fields, helper variables, and optionally, additional data supplied through this field's value (which can be set in the manipulation function). Note that this takes place server-side and no modification or re-rendering can be performed on the browser.

This is the field you should be using (rather than the browser-side version) if you need to display data retrieved from the API Server to a user.

Properties

LabelDescriptionType Name
SummaryA short description of what the field does, displayed in the forms designer to help identify itSUMMARY
TemplateThe Handlebars template. Handlebars templates look like regular HTML, with embedded handlebars expressions. There's more information in the Handlebars Editors articleTEMPLATE
OutputDetermines when the HTML should be output. By default, the HTML will only be included when the form is rendered on the site.

The following options are available:

Always - the HTML will be displayed on your site and in read-only modes
Form - the HTML will only be output when the form is being rendered on the site (in "standard" mode)
Summary (Email) - the HTML will only be output when the form is rendered in read only mode, without controls, for example in emails
OUTPUT
Manipulation FunctionA function that can manipulate the JSON data object supplied to the template. This function is executed server-side before generating any HTML. It is supplied with two parameters, a reference to the helper library and the current value of the JSON object. The second parameter is always supplied as a JavaScript JSON object. It will never be null or undefined. You may use this function to call the API Server, the values of fields on preceding pages, or values of fields placed before this one on the current page.

For example:

function (helper, value) {
    // Add a field called fullName to the object
    value.fullName = helper.getFieldValue("FIRSTNAME") + " " + helper.getFieldValue("LASTNAME"); 
    return value;
}

Server Template Function
CALCFUNCTION
Additional Styling ModifierAn optional CSS modifier for the field. See Common Field Properties for an exampleADDITIONALSTYLINGMODIFIER
DocumentationAdd documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an exampleDOCUMENTATION
Last modified on 21 October 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon