Fields and Expressions
A field node’s expression is a Liquid expression without the braces: a path into your data, optionally with filters.
{ "type": "field", "attrs": { "expression": "invoice.issued_on | date: \"%B %-d, %Y\"" }}- A path has
.between its parts:customer.namereads{ "customer": { "name": "..." } }, the fieldcustomer/name. - Page designs have the same Liquid filters as HTML templates, such as
upcase,currency,delimitedanddate.sumalso reads amounts written as text, such as"$40"(Footer row). - An expression can’t contain
{{,}},{%or%}.
Fields go in rich text and in the value of a
QR code or barcode.
Images, tables and repeating sections
name a field by its path, without filters.
A table or repeating section goes through a list in your data (source) and gives each entry a name (as). Inside it,
that name reaches the entry’s values: in a table over line_items as line_item, a cell reads
line_item.description. The editor names a new loop’s entries with the singular of its list.
These names can’t be used: true, false, nil, null, empty, blank, forloop, tablerowloop, and, or
and contains.
The fields DocSpring adds
Section titled “The fields DocSpring adds”When you save a layout, DocSpring adds a field for each new value it reads, with a type that fits how it’s used:
- A value whose first filter is
dateorin_time_zoneis a date. - A value formatted as a number (
currency,delimited,round,plusand the other number filters), or compared with>,<,>=,<=or a number, is a number. - A value used on its own as a condition, or compared with
trueorfalse, is a true/false value. - An image’s field is an image.
- A table’s or repeating section’s
sourceis a list, with a field for each value read from its entries:line_items/~/description. - Anything else is text.
Fields it already has are kept as they are, including fields the layout no longer reads. You can change a field’s type
afterwards. If you delete a field while the layout still reads its value, saving the layout doesn’t add it back, and a
submission without that value fails with an undefined variable message.