Dynamic Fields
Audience:
Low-code EngineersSkill Prerequisites:
Forms,Tokens
The Dynamic Fields actions add fields to a form while it loads, instead of placing them in the form builder. Use them when the fields a form needs aren't known until runtime, for example one question for each row in a database table, or extra fields that depend on the user.
Each action adds one field of a particular type, such as a textbox, dropdown or file upload, into a Dynamic Field Container on the form. Load dynamic field from JSON adds several fields of any type in one step.
Dynamic fields require the Forms Dynamic feature to be licensed. If it isn't, the actions fail with a message that the feature is unlicensed.
How it works
- Add a Dynamic Field Container field to the form. You'll find it in the Hidden Data category of the field list. Its ID, for example
Questions, is theContainer Idthe actions use. The container's layout and CSS settings are copied to every field added to it. - Add the Dynamic Fields actions to the form's On PreInit or On Init actions. The fields are created each time the form loads. Fields added by actions on a button click aren't displayed.
- Fields appear in the order the actions run. To add a field for each row of a list, put the action inside Execute Actions for each List Entry and build the
Field Idfrom the list's tokens. - Submitting the form. The added fields are remembered and validated like normal fields. Each field's value is available in the
[FieldId]token, just like a field placed in the form builder.
Dynamic Field Container tokens
When the form is submitted, the container provides the values of all its dynamic fields in two extra tokens:
| Token | Example |
|---|---|
[<ContainerId>:Json] | {"Color":"red","Nickname":"Jay"} |
[<ContainerId>:QueryString] | Color=red&Nickname=Jay |
These are useful when you don't know the field IDs in advance, for example to save all answers to one database column with Run SQL Query.
The container's Submit Hidden Fields setting controls whether fields hidden by a Bind Expression - Show are still submitted.
Field IDs
Field Idis cleaned the same way as IDs in the form builder: leading characters that aren't letters are removed, and so is every character other than letters, numbers and_. For example,1st Name!becomesstName. If nothing is left, the action fails with Invalid field id.- Every field on the form needs a unique ID. If a field with the same ID already exists, the action fails with Field Id ... already exists in this form.
- Each Add action saves the cleaned ID in a token, so later actions can refer to the field. See
Field ID Token Namebelow.
Common Parameters
Most Add actions share the parameters below. Each action's page lists its own additional parameters and any of these it doesn't have.
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Container Id | The ID of the Dynamic Field Container to add the field to. If it's empty, the action does nothing, without an error. If no container has this ID, the action fails with Specified field container was not found. | Yes | empty string | Yes |
| Field Id | The ID of the new field, used in the [FieldId] token. See Field IDs. | Yes | empty string | Yes |
| Field Title | The field's label. It's required even for fields that don't show a label, such as hidden fields. | Yes | empty string | Yes |
| Field Description | Help text shown with the field. | Yes | empty string | No |
| Enable Conditionally | A condition that decides whether the field accepts input, for example [Status] == "Draft". It's evaluated when the form loads. When set, it overrides the container's enabled setting. | Yes | empty string | No |
| Initial Value | The field's starting value. It's also placed in the [FieldId] token straight away, so the actions that follow can use it. | Yes | empty string | No |
| Secure Input | When checked, the submitted value is HTML-sanitized. Available on Add Textbox, Add Large Text and Add Hidden Field with Custom Value. See Secure Input. | No | Checked | No |
| Bind Expression - Show | A JavaScript condition that shows or hides the field as the user fills in the form, for example [PaymentMethod] == 'CreditCard'. | See Tokenize Bind Expressions? | empty string | No |
| Preserve Layout? | When checked, hiding the field keeps its space so the layout doesn't shift. | No | Unchecked | No |
| Bind Expression - Value | A JavaScript expression that calculates the field's value from other fields, for example [FirstName] + ' ' + [LastName]. Once the user edits the field, it stops updating. | See Tokenize Bind Expressions? | empty string | No |
| Bind Expression - On Change/Click | JavaScript to run when the value changes. Refer to fields with [FieldId], which maps to form.fields.FieldId.value. Requires the Scripting feature to be licensed. | See Tokenize Bind Expressions? | empty string | No |
| Tokenize Bind Expressions? | When checked, tokens in the three bind expressions are replaced when the field is added. In Show and Value, a token that names a field becomes a reference to that field, which is what you need when field IDs are built from tokens. In On Change/Click, tokens are replaced with their values. | No | Unchecked | No |
| Readonly | Makes the field read-only. Enter true, false, 1, 0 or a condition. Only Add Textbox applies this setting. | Yes | empty string | No |
| CSS Class | CSS classes for the input, added to the container's classes. | Yes | empty string | No |
| CSS Styles | Inline styles for the input, added to the container's styles. | Yes | empty string | No |
| Label CSS Class | CSS classes for the label, added to the container's label classes. | Yes | empty string | No |
| Label CSS Styles | Inline styles for the label, added to the container's label styles. | Yes | empty string | No |
| Is Required | Whether the field must be filled in. Enter true, false, 1, 0 or a condition such as [Type] == "Business". Empty means not required. | Yes | empty string | No |
| Validation Condition | A condition that decides whether the field's validation runs, for example [Country] == "US". | See Tokenize Validators? | empty string | No |
| Custom Validator #1, #2 | Validators to apply, chosen from the form's validators. | See Tokenize Validators? | none selected | No |
| Tokenize Validators? | When checked, tokens in the validators and Validation Condition are replaced when the field is added. When unchecked, they're replaced when the form is submitted, so they can use the submitted values. | No | Checked | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Field ID Token Name | Optional. The name of a token that receives the cleaned field ID. If empty, the ID is saved in [<FieldId>:Name] instead. |
List Parameters
The actions that add list fields (dropdowns, checkbox lists, radio boxes and tags) get their options from a data source. They share these parameters:
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Data Source | Where the options come from. Pick a data source, then fill in its settings. See the common data sources below. | Yes | none selected | Yes |
| Tokenize Datasource Parameters | When checked, tokens in the data source settings are replaced when the field is added. Keep it checked when the action runs inside Execute Actions for each List Entry, because the loop's tokens only exist at that moment. | No | Checked | No |
| Link To | Dropdown, Dropdown with Checkboxes, Checkbox List and Radio Boxes only. The IDs of one or more fields, separated by commas, that this list depends on. When one of them changes, this list only shows options whose value starts with the selected value. See Cascading lists. | Yes | empty string | No |
Common data sources
| Data source | Settings |
|---|---|
| Items | Items List: one option per line, as Text|Value, for example Red|R. If there's no |, the text is also the value. |
| SQL Query | A query that returns the options. Return one column, or two columns named Text and Value. Requires the Data Integration feature. |
Other data sources, such as users, roles, countries and time zones, are also available.
In exported action JSON, the data source is stored as one object: the data source name in Value, and its settings beside it:
"DataSource": {
"Expression": "",
"Value": "Items",
"IsExpression": false,
"Items": "Red|R\nGreen|G\nBlue|B"
}
Cascading lists
To make a list depend on another field, enter that field's ID in Link To, and start each option with the parent value followed by /. For example, a City list linked to a Country field could use these items:
US/New York|NYC
US/Chicago|CHI
UK/London|LON
When the user picks US in Country, City only shows New York and Chicago. To use a / in an option's text, write \/.
Values of list fields
| Field type | [<FieldId>] after submit |
|---|---|
| Single choice: Dropdown, Dropdown with Autocomplete, Radio Boxes | The selected value. |
| Multiple choice: Checkbox List, Dropdown with Checkboxes, Tags Input | The selected values, separated by commas, for example R,B. [<FieldId>:Text] gives the texts separated by commas and spaces, and [<FieldId>:JsonArray] gives the values as a JSON array. |
Considerations
- Use On PreInit or On Init. Dynamic fields must be added while the form loads.
- Watch empty tokens. If
Container Idcomes from a token that turns out empty, no field is added and no error is shown. - A form field wins. If a dynamic field and a field placed in the form builder somehow share an ID, the form builder field's value is used.
Actions in this category
| Action | Adds |
|---|---|
| Add Textbox | A single-line text input. |
| Add Large Text | A multi-line text area. |
| Add Number Input | A number input with optional minimum and maximum. |
| Add CheckBox (True/False) | A single checkbox. |
| Add Hidden Field with Custom Value | A hidden value that's submitted with the form. |
| Add StaticText | Text that's displayed but not submitted. |
| Add Slider | A slider for choosing a number. |
| Add Date Time Picker | A date, time, or date and time picker. |
| Add Date and Time (Deprecated) | The older date picker. Use Add Date Time Picker instead. |
| Add Dropdown | A dropdown list. |
| Add Dropdown with Autocomplete | A searchable dropdown. |
| Add Dropdown with Checkboxes | A dropdown that allows several selections. |
| Add Checkbox List | A list of checkboxes. |
| Add Radio Boxes | A list of radio buttons. |
| Add Tags Input | An input for entering several tags. |
| Add Single File Upload | An upload field for one file. |
| Add Multi File Upload | An upload field for several files. |
| Load dynamic field from JSON | Several fields of any type, described in JSON. |
Revised 09/25/2026