User Tools

Site Tools


hidden_fields

Hidden Fields

The Hidden Field is used as a temporary storage of either a value or an array of values. The field is invisible on the device.

 Click on the Hidden Field button to add a hidden field to any page in your app. Like any other input or output field, the value of this field can be used in a JavaScript statement or as an input or output of a web service or a database field value. There is a Default Value property that you can preset to a fixed value, such as a URL, or you may leave this blank.

Typical Usage

Typically, a Hidden Field is used to store something in a delayed action or store a hidden value.

For example, the value from a data source may be a decimal number, but you want to show a Text Label field that looks like a percentage. The steps are:

  1. The data query writes to a Hidden Field instead of the Text Label field
  2. JavaScript code after the query computes the Text Label field based on the Hidden Field.

JavaScript code for this example might look like this:

var showPercent = ( getFieldValue( 'hidden_percent' ) * 100 ) + '%';
setFieldValue( 'showPercentLabel', showPercent );

Device ID

The Hidden Field properties have a second option besides the Default Value. Select the Set Value To property as Device ID, and the hidden field will report a unique identifier for that specific device. The Device ID is often used to register unique devices for individual users, or can be used to distinguish unique users without requiring a user login, such as collecting responses to a survey.