Toggle menu

helper.utilGetFieldNames([pageName])

Returns the names of all fields on a named, or all pages, of a form.

The long and short names of fields are returned in separate arrays. If a form doesn't have an external type, the field names in each array will be the same. See Field Names and External Types for an explanation of long and short names.

Executed

Client-side and server-side.

Arguments

ArgumentTypeDescription
pageNameString, optionalOnly return the fields on the named page

Returns

An array of objects, each representing a page of the form.

PropertyTypeDescription
pageNameStringThe name of the page
fieldsLongArrayAn array containing the full names of all fields on the form
fieldsShortArrayAn array containing the names of the fields on the form minus any external type prefixes

Example

This example shows a multipage form with an external type. Non-storing fields (layouts, browser-side "display" fields etc) do not need to be present in the external type definition, so only have a short name, although they are listed in the fieldsLong array.

[{
    "pageName": "PAGE1",
    "fieldsLong": ["GUIDANCETEXT", "LAYOUT1", "FORM_TIMSFORM.FIRSTNAME", "FORM_TIMSFORM.FAMILYNAME", "FORM_TIMSFORM.ADDRESS", "FORM_TIMSFORM.LOCATION", "HTMLFIELD", "BUTTON"],
    "fieldsShort": ["GUIDANCETEXT", "LAYOUT1", "FIRSTNAME", "FAMILYNAME", "ADDRESS", "LOCATION", "HTMLFIELD", "BUTTON"]
}, {
    "pageName": "PAGE2",
    "fieldsLong": ["LAYOUT2", "FORM_TIMSFORM.EMAIL"],
    "fieldsShort": ["LAYOUT2", "EMAIL"]
}]

Last modified on 9 March 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon