Automette docs
Templates

Typst field types

Annotations

Write an annotation as a comment after the field, inside the #let data = (...) block: // @type: date @format: DD MMM YYYY.

AnnotationBox shown on the Generate page and in formsValue the template receives
@type: textOne line of textThe text
@type: textareaSeveral lines of textThe text
@type: numberA numberText; use int() or float() to calculate
@type: date @format: …A date pickerThe date written in the @format pattern
@type: booleanA checkbox"true" or "false"
@type: imageAn upload, or a link to an imageThe uploaded file's name or the link
@type: colorA colour pickerA hex value, such as "#1a56db"; use rgb()
@type: urlOne line of textThe link
@type: array @columns: …A table where rows can be added and removedA list of rows to loop over
@type: jsonA box for JSON textText; read it with json(bytes(...)). Older templates only
@label: …Sets the label shown above the box

@type: date without @format is a plain text box.

A field with no annotation gets a type from its name: a name ending in _date is a date, qty, amount or total is a number, logo or photo is an image, color is a colour, url or link is a link, notes or description is several lines of text, and names starting with is_ or has_ are checkboxes.

Date format tokens

TokenPrints
DDDay with a leading zero (01 to 31)
DDay without a leading zero (1 to 31)
MMMMFull month name (January)
MMMShort month name (Jan)
MMMonth number with a leading zero (01 to 12)
MMonth number without a leading zero (1 to 12)
YYYYFour-digit year (2026)
YYTwo-digit year (26)

List columns

@columns lists each column of an array field as name:type, separated by commas: @columns: desc:text,qty:number,amount:number.

Column types: text, number, date, boolean, image, color, url. A date column can carry its format: delivery_date:date:DD MMM YYYY.

Where values come from

Way of generatingValues come from
Generate pageThe boxes on the page
Bulk generationOne row of the CSV file per document; column headers match field names
FormsEach response, through the form's field mapping
APIThe data object in the request
Dynamic URLsThe values in the link

Every value arrives as text, except array fields, which arrive as a list. A field that is not sent prints blank; see Blank values.

Last updated on

On this page