Skip to main content
Version: 1.28 (Current)

Forms 2.0 - Working with Form Data

caution

This page is preliminary and subject to change as Forms 2.0 continues to be developed.

This page shows how to read the values in a Forms 2.0 form: one field at a time, a group of fields, or the whole form at once. It also covers giving fields values when the form opens, and changing them after a button click. For the order in which all this happens, see Lifecycle.

Field names​

Every field is read through a token with its name, for example [Email]. A field inside a Section or Repeater uses its full name: the Section's or Repeater's Name, a colon, and the field's Name, for example [Billing:City]. Layout Containers and Dynamic Containers don't add to the name. See Common Field Settings.

Values at submit​

When the user clicks a button, every submitted value becomes a token before the button's actions run.

One field​

TokenValue
[FieldName]The field's value, for example [Email].
[Section:FieldName]A field inside a Section, for example [Billing:City].
[FieldName:Part]Some field types have extra parts, for example [Price:Currency] for a Money field or [Phone:CountryCode] for a Phone field. See each field's page under Tokens.
[_Form:ButtonName]The full name of the button that was clicked. Useful when several buttons share actions.

Fields that weren't submitted - inactive fields, and hidden or disabled fields that aren't set to submit their value - have no token. A Cancel button doesn't create field tokens at all.

Many fields at once​

TokenValue
[FormData]The whole form as one JSON object. Each field is keyed by its own Name. A Section is a nested object, and a Repeater is an array of entries.
[SectionName]A Section's fields as a JSON object, for example [Billing].
[ContainerName] or [ContainerName:Json]A Dynamic Container's fields as a JSON object. [ContainerName:QueryString] gives them as Name=Value&....
[RepeaterName]A Repeater's entries as a JSON array. Its entries are also available as lists for looping. See Repeater.

A Layout Container has no value of its own. Its fields appear directly in their parent's object.

For example, a form with FullName, a Section Billing with City, and a Repeater Phones with Number gives this [FormData]:

{
"FullName": "Ana Pop",
"Billing": { "City": "Cluj" },
"Phones": [ { "Number": "0722 000 000" }, { "Number": "0733 000 000" } ]
}

Use [FormData] to save a whole form in one column, to pass it to an API with Server Request, or to put it back later with Refresh Form Data from JSON.

Data kept from opening​

Tokens created while the form opened, in On Preinit or After Fields Initialization, aren't available at submit unless you keep them with Persist data for submit. See Keeping data until submit.

Values when the form opens​

Giving fields their starting values​

  • A field's Initial Value - a fixed value or tokens, for example [User:Email].
  • A token in On Preinit - a token created in On Preinit with a field's full name becomes its starting value, replacing Initial Value. Load a record with Run SQL Query and use Extract Columns to save each column under its field's name, for example column Email as Email, and column City as Billing:City.
  • A Repeater's entries - create the list named in its Initial Entries in On Preinit. See Repeater.

Reading the starting values​

In After Fields Initialization, every field's starting value is available as its token, for example [Email] or [Billing:City]. Use it to look up more data based on those values. In On Preinit, the fields don't have values yet: only the tokens you created there exist.

Changing values after a click​

The button's actions can change what the form shows, without reloading the page:

ActionUse it to
Refresh Field DataSet a few fields you list, and keep running actions.
Refresh Form Data from JSONSet many fields from a JSON object, including Sections and Repeater entries.
Refresh Form Data from ContextRefresh every field from the tokens with the same names, as the last action.

Values in the browser​

The Value, Reactive Visibility Rule, Enable Dynamically, On Change, and On Click settings run JavaScript in the browser, without a request to the server. There, the form's fields are in the form object: form.Email.value, or form['Billing:City'].value for a full name. See Referring to fields in expressions.


Last updated: November 18, 2026