Return to last viewed topic Go to previous topic Go to next topic
Send us documentation feedback Technical support Learning Center Print topic

Using the Data Designer


Custom Validation

The Plain Text and Calculation field dialogs feature a validation section (illustrated below).

You can use the validation feature to ensure the following about the user's input.

- text

- URL

- whole number

- decimal number

- floating point number (Floating point includes scientific notation, so is appropriate for scientific numbers. Decimals usually suffice for business numbers.)


Note

Your system administrator may customize the choices.


- between two values (either another field or a number that you specify)

- less than

- equal to

- not equal to

- maximum length (usually for text responses)


Note

Your system administrator may customize the choices.


If the user's response fails to meet the criteria, you can compose an error message that appears when the data does not satisfy the criterion. Your system administrator determines if a user can save the invalid data.

When the Custom Validation button is clicked, the Custom Validation dialog appears.

When the Select Field button is clicked, the Select a Field or Group dialog appears.

This dialog displays fields that can be inserted into the Condition field. Some field types, like the RichArea field, are not listed. See Also: Referencing Other Calculated Fields

Example of Creating Custom Validation

As an example of custom validation, assume that a field collects telephone numbers, and you want to make sure the user enters 10 digits. To accomplish this, follow these steps.

  1. Click the Plain Text Field dialog and complete the screen.
  2. In the validation section, click Custom Validation. The Custom validation screen appears.

  1. In the Data Type field, select Whole Number from the drop down list. This ensures that the user can only enter digits.

  1. Click the down arrow to the right of the Examples field to see sample logic.

  1. Click Maximum text length... . This option lets you specify the length of the user's response.
  2. string-length(.) <= {X} appears in the Condition field.
  3. Since you want the user's input to equal 10, remove the less than sign (<) from the calculation. Now it looks like this: string-length(.) = {X}.
  4. Replace the X with 10. Now, it looks like this: string-length(.) = {10}.
  5. Move the cursor to the Error Message field and compose a relevant error message. For example: must be 10 digits.
  6. Your screen should look like this.

  1. Press OK and return to the Plain Text field dialog.
  2. Press OK to save that dialog and test the validation on the phone number field. To do this, switch to Data Entry mode and enter more or fewer than 10 digits, as well as non-digit characters to verify that validation works as expected.


Send us documentation feedback Technical support Learning Center Print topic Return to last viewed topic Go to previous topic Go to next topic