Load dynamic field from JSON
Audience:
Low-code EngineersSkill Prerequisites:
Forms,JSON,Tokens
Adds several fields of any type to a Dynamic Field Container in one step, from a JSON description. It's useful when the form's fields are stored somewhere else, for example in a database table that defines a questionnaire.
See Dynamic Fields for how dynamic fields work and how to set up the container.
Typical Use Cases
- Build a form from field definitions stored in the database, for example survey questions
- Add a mix of field types without one action per field
Don't use it to
- Add one simple field. The individual Add actions, such as Add Textbox, are easier to set up and check their settings.
Related Actions
| Action Name | Description |
|---|---|
| Run SQL Query | Loads the JSON from the database. |
| Add Textbox | Adds a single field, with checked settings. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Container Id | The ID of the Dynamic Field Container to add the fields to. | Yes | empty string | Yes |
| Fields Json | A JSON array of field objects. See JSON format. | Yes | empty string | Yes |
JSON format
Each object in the array describes one field. The most useful properties are:
| Property | Description |
|---|---|
Name | The field ID, cleaned like Field Id in the other actions. If empty, Title is used. |
Title | The field's label. |
InputTypeStr | The field type. See the table below. Unknown types become a textbox. |
ShortDesc | Help text shown with the field. |
IsRequired | true to make the field required. |
EnableCondition, BindShow, BindValue, BindOnChange, ValidationCondition | The same expressions as in the form builder. |
CssClass, CssStyles, LabelCssClass, LabelCssStyles | CSS, added to the container's CSS. |
Parameters | An object with the field type's own settings. Value is the initial value. For list fields, DataSource holds the options, for example {"Value": "Items", "Items": "Red|red\nBlue|blue"}. |
Common field types:
InputTypeStr | Field |
|---|---|
open-text | Text Box |
open-text-large | Large Text |
open-number | Number |
closed-truefalse | CheckBox (True/False) |
closed-multiple-dropdown | Dropdown |
closed-multiple-radio | Radio Boxes |
closed-multiple-checkbox | Checkbox List |
dropdown-checkboxes | Dropdown with Checkboxes |
dropdown-autocomplete | Dropdown with Autocomplete |
tags-input | Tags Input |
hiden-constant | Hidden Field with Custom Value (the ID is spelled this way in the product) |
static-text | Static Text |
slider | Slider |
date-flatpickr, time-flatpickr, datetime-flatpickr | Date, time, or date and time picker |
upload.single, upload.multi | Single or Multi File Upload |
The layout settings (position, columns, visibility and enabled state) always come from the container and can't be set in the JSON.
Considerations
- Silent when there's nothing to do. If
Fields Jsonis empty or an empty array, or no container has the given ID, the action finishes without adding anything and without an error. - Invalid JSON makes the action fail with the JSON parser's error message.
- Unique IDs. The action fails if two fields in the JSON have the same ID, or if a field's ID is already used on the form.
- Fewer checks. Unlike the individual Add actions, this action doesn't create
[<FieldId>:Name]tokens or place initial values in tokens, andIsRequiredmust betrueorfalse, not a condition. - Use On PreInit or On Init, like the other Dynamic Fields actions.
Examples
To understand how to use the below examples, please see Running Examples.
1. Add a textbox and a dropdown from JSON
Add this action to the form's On PreInit or On Init actions. It adds a required Nickname text box, prefilled with the user's display name, and a Favorite Color dropdown to the ExtraFields container.
{
"Title": "Load dynamic field from JSON",
"ActionType": "LoadDynamicFieldsFromJson",
"Description": "Add the profile questions",
"Condition": null,
"Parameters": {
"ContainerId": "ExtraFields",
"FieldsJson": "[{\"Name\":\"Nickname\",\"Title\":\"Nickname\",\"InputTypeStr\":\"open-text\",\"IsRequired\":true,\"Parameters\":{\"Value\":\"[User:DisplayName]\"}},{\"Name\":\"Color\",\"Title\":\"Favorite Color\",\"InputTypeStr\":\"closed-multiple-dropdown\",\"ShortDesc\":\"Pick one\",\"Parameters\":{\"DataSource\":{\"Value\":\"Items\",\"Items\":\"Red|red\\nBlue|blue\"}}}]"
}
}
The JSON in Fields Json, formatted for reading:
[
{
"Name": "Nickname",
"Title": "Nickname",
"InputTypeStr": "open-text",
"IsRequired": true,
"Parameters": { "Value": "[User:DisplayName]" }
},
{
"Name": "Color",
"Title": "Favorite Color",
"InputTypeStr": "closed-multiple-dropdown",
"ShortDesc": "Pick one",
"Parameters": {
"DataSource": { "Value": "Items", "Items": "Red|red\nBlue|blue" }
}
}
]
Revised 09/25/2026