Skip to main content
Version: 1.28 (Current)

Load dynamic field from JSON

Audience: Low-code Engineers

Skill 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.
Action NameDescription
Run SQL QueryLoads the JSON from the database.
Add TextboxAdds a single field, with checked settings.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Container IdThe ID of the Dynamic Field Container to add the fields to.Yesempty stringYes
Fields JsonA JSON array of field objects. See JSON format.Yesempty stringYes

JSON format​

Each object in the array describes one field. The most useful properties are:

PropertyDescription
NameThe field ID, cleaned like Field Id in the other actions. If empty, Title is used.
TitleThe field's label.
InputTypeStrThe field type. See the table below. Unknown types become a textbox.
ShortDescHelp text shown with the field.
IsRequiredtrue to make the field required.
EnableCondition, BindShow, BindValue, BindOnChange, ValidationConditionThe same expressions as in the form builder.
CssClass, CssStyles, LabelCssClass, LabelCssStylesCSS, added to the container's CSS.
ParametersAn 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:

InputTypeStrField
open-textText Box
open-text-largeLarge Text
open-numberNumber
closed-truefalseCheckBox (True/False)
closed-multiple-dropdownDropdown
closed-multiple-radioRadio Boxes
closed-multiple-checkboxCheckbox List
dropdown-checkboxesDropdown with Checkboxes
dropdown-autocompleteDropdown with Autocomplete
tags-inputTags Input
hiden-constantHidden Field with Custom Value (the ID is spelled this way in the product)
static-textStatic Text
sliderSlider
date-flatpickr, time-flatpickr, datetime-flatpickrDate, time, or date and time picker
upload.single, upload.multiSingle 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 Json is 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, and IsRequired must be true or false, not a condition.
  • Use On PreInit or On Init, like the other Dynamic Fields actions.

Examples​

tip

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