•••
 
Documentation   /   Building templates   /   Template fields
 
 

Template fields

 

A field is how a template collects a value for one of your variables. Each field is a block of directives starting --#:.

--#:
---name:notice_period
---type:dropdown
---appears_on:extras
---mini_label:Notice period
---options:"1 week","1 month","3 months"
---selected_dd:1 month
---required:true

Where fields appear

The document creation form has sections. ---appears_on decides which section a field is in:

Section Holds
counterparty Who the document is with: name, address
signatory Who will sign: name, job title, email
dates The document's start and end dates
extras Everything else

Launch form fields in workflows use settings instead. See Launch forms.

Field types

Type Shows
text A one-line text box
textarea A multi-line text box. Set the height with ---rows.
amount A money field, with a currency symbol (---currency:, default £)
date A date picker. Format the output with ---format.
dropdown A dropdown. Needs ---options.
select_multiple A list where several options can be chosen. The value is output as a bulleted list.
checkbox A single tick box, with ---checkbox_msg as its label
toggle An on/off switch
attach_file A file upload
section A heading that groups the fields after it
hidden No visible field. Holds a value passed in, or a default.

Showing and hiding fields

---hide_if hides a field depending on another field's value:

--#:
---name:fixed_term_end
---type:date
---appears_on:dates
---mini_label:End of fixed term
---hide_if:contract_type(NOT_EQUALS Fixed term)

The condition uses match types.

Fields inside the document

Normally fields appear on the creation form, and their values are written into the document. Add ---collect_data:true and the field appears in the document itself, where the recipient fills it in. This is how forms work. See Forms and web pages.

Validating input

---string_format checks what's typed, for example number, email, currency or regex=^[A-Z]{2}[0-9]{6}$. See String formats.

Formatting output

---format changes how the value appears in the document:

  • For dates: a date format such as D MMMM YYYY (the default, e.g. 5 January 2027), DD/MM/YYYY or ISO 8601. See Date formats.
  • For text: ucfirst (capitalise the first letter) or lcfirst (lowercase the first letter).

See Template field directives for every directive.