Create a new dynamic field on a template.
Use this tool when:
- The user wants to add a variable / fill-in field (e.g. text, number, date, select) to a template
- You are building up a template and need a placeholder whose value is filled in per document
IMPORTANT: this is only the first of two steps. Creating the field does NOT place it in the template content, so on
its own the fill-in placeholder will not appear in the document text. To make it show up, reference the returned
`ref_uuid` in the template body (via replace-template-content) as:
<span data-dynamic-field data-ref-uuid="<dynamic field ref_uuid>"></span>
Until it is referenced in the content the field exists but is rendered nowhere. The same two-step pattern applies
to signature blocks (create-template-signature-block, then
`<div data-signatures><span data-signature-block data-ref-uuid="..."></span></div>`).
Dynamic fields define the variable data filled in when a template is used to create a document. Each field has a
`type` controlling what values it accepts, and a `scope` controlling who fills it in.
A party's name or address is never a dynamic field. Both live on the party record: add the party with
create-template-party and render its details in the content with
<span data-party data-ref-uuid="..." data-format="name"></span>, taking data-format="address" for the address as a
block and data-format="address:inline" for it on one line, as a preamble reads it. A document made from the
template then follows its own parties.
`select` and `multi_select` fields require `select_values` (the allowed options).
The optional default value is set via `value` (for non-multi_select fields) or `values` (for multi_select fields).
Construct the `value` string according to the field `type`:
- number: the numeric value in a string, using '.' as the decimal separator -> "1234.56"
- currency: concatenate the ISO currency code and the numeric value with a ';' -> "EUR;1000.10"
- currency_duration: same as currency, but append another ';' followed by either `monthly` or `yearly` -> "EUR;1000.10;monthly"
- select: one of the options from `select_values` -> "red"
- multi_select: an array of the selected options in the `values` field -> ["red", "blue"]
- bool: either of the strings "true" (shown as "Yes") or "false" (shown as "No")
- duration: a PHP-compatible duration specification -> "P6D" (6 days)
- date: the date in the format "YYYY-MM-DD" -> "2026-12-31"
- email, text, textarea, or any type not listed above: a string -> "test@example.com"