Using the runtime API you can use patterns to retrieve information and objects pertaining to the form. For detailed documentation see the class reference.
Here are some basic examples:
// Selecting the current form. K('form') // Selecting a form by slug. If multiple forms of the same slug are loaded you will // receive an array of forms. K('form[ipad-request]') // Selecting a field by name. K('field[FirstName]') // Selecting a bridged resource by name K('bridgedResource[People]')
Other supporting form data can also be selected.
// Selecting the current page K('page') // Selecting the current submission data. K('submission') // Selecting the current kapp. K('kapp') // Selecting the current identity. K('identity')
Many selectors can be nested, for example:
// Selecting a field by name which is on the current page. K('form page field[FirstName]')
Selectors imply the active form so the ‘form’ selector can nearly always be omitted:
// Get the FirstName field for the current page. K('page field[FirstName]')
A number of form elements can also be selected by their names:
// Selecta a button by name K('button[Refresh List]') // Select a section by name K('section[Personal Information]') // Select a text element by name. K('text[Introduction]')