Validation Builder

Compose Enterprise is going through a design update. The illustrations on this page might be of the old design, but the information is up to date. Thank you for your patience during this update!

Norsk

In the validation builder you create your own validations or edit previously made validations. A validation is a set of conditions, which makes sure the respondent users enter information in a format in accordance with the validation rules. The validation builder has three main sections: EditPublished, and Languages. Before entering the validation builder you need to create a new validation or open an existing validation (see Organizer chapter).

Edit

A validation is identified by its structure in terms of number of characters, its default validation and customized validation rules either through a script or a generic service. The Edit section consists of a Properties panel, which again consists of initial settings, a window for generic service based validations and a window for script based validations.

Initial Settings

Initial Settings

Initial Settings

State

Displays whether you are editing a DRAFT or a PUBLISHED validation.

Validation

A dropdown menu with base validations for your validation. Default validations such as StringIntegerDecimal, and Date are available, including all published validations in your workspace.

Input Size Range

Choose the minimum (right input field) and maximum (left input field) amount of characters of the validation input format.

Default Input Size Limit

Limit the amount of characters in the input. 

Generic Service

Generic Service

Generic Service

Generic Service

To trigger a Generic Service as the validation, select the generic service by browsing your workspace.

Version

Select the version of the generic service you wish to use for the event. Choose whether you would like the generic service to update to the highest minor version automatically in the check box to the right.

Map Request Variables

Map all the generic service request variables to static values or input value (using the input given). The map request variables button is not enabled before you select a generic service.

Map Result Variable

Map the validation result variable. If the result variable sends back either nothing (null), 0 or false, the validation is considered to have failed. Sending any other value indicates a passed validation.

Validation Error Message

If the validation fails, the error message entered here will be shown to the respondent user. The error message may be written in multiple languages in the Languages section in the validation builder.

Test

Before publishing a data type it needs to be tested. Click TEST and enter the value you want to test. The Function Validator Window is revealed. The validation will run with the properties in the draft and the status of the entered value will be shown (passed or failed).

Publish

When clicking PUBLISH, the validation will be available for use. If the validation is already in use you will have the option to REPUBLISH. When the validation is republished all items using this validation will use the newest published version of the validation.

Revert to publish

Revert the draft you're working on to the published version.

Script

Script



Script



Validation Code

When the validation is running, i.e. when a respondent has given an answer to a question with this validation, the validation code will run to check that the entered information is on the correct format. SSN and Organizational numbers are typical input given by respondent users which should be validated to make sure that the entered value has the correct format. The code language is Groovy.

Validation Error Message

If the validation fails, the error message entered here will be shown to the respondent user. The error message may be written in multiple languages in the Languages section in the validation builder.

Test

Before publishing a data type it needs to be tested. Click TEST and enter the value you want to test. The Function Validator Window is revealed. The validation will run with the properties in the draft and the status of the entered value will be shown (passed or failed).

Publish

When clicking PUBLISH, the validation will be available for use. If the validation is already in use you will have the option to REPUBLISH. When the validation is republished all items using this validation will use the newest published version of the validation.

Revert to publish

Revert the draft you're working on to the published version.

Examples

If the field is to contain exactly 6 characters:
value.length () == 6

If the field is to contain 6 characters or more:
value.length ()> = 6

Published

In the Published section, the latest published version of the validation is displayed. The section is visually nearly identical to the Edit section, with the exception of the overview Items using this validation, and the lack of a Publish and Revert to publish button. If the validation is used by Compose elements, these items will be listed under Items using this validation. If you change and republish the validation, all of these items will be running the updated validation.

Languages

The Languages section is similar to the Languages section in the form builder.

Make your choices. When you are happy about your changes, click Publish. Your validation should now be possible to select across Compose builders.