Creating field masks and regular expressions

A mask defines the content format that must be typed into a text field.

Setting up a mask

To set up a mask in your field, access your process in the process editor, select the data entry element, and click on the clipboard icon or in the properties on “Configure Form.”

In the “Edit” window that opens, click “More options” to select the field you want. If you don’t have a field yet, you can create it by following this link Creating forms.

 

 

Fill in the “Mask” field with the input format.

 

Here are some examples of masks:

 Social Security Number (US)000-00-0000
 National Insurance Number (UK)SS000000S
 CEP (Brasil)00000-000
 NIF (Portugal)000000000
 CEP (Portugal)0000-000
 BI (Angola)999999999SS999

 

A tip when creating your own masks:

  • The letter S allows the user to enter only letters [A-Za-z];
  • The letter A allows the user to enter numerals or letters [A-Za-z0-9];
  • The numbers 0 and 9 allow the user to enter only numbers [0-9].

The  “Placeholder” field serves to assist the user in filling the field, you can, for example, show how to fill it out or explain its function. This text is visible only while the field is empty.

 

The “Reverse mask” option makes the values ​​entered in the field begin to fill the mask from right to left, this can be useful in phone fields, where you can enter 8 or 9 numbers, or cash values ​​that need the comma and two more digits (200.00).

 

Validation by regular expressions

To validate if the content conforms to the mask, set up a regex for the  “Regular expression” field and define the message to be displayed if it is not met.

 

Read more about Regular Expressions:

Testing Configurations

You can now validate your configurations by opening a test. See more at How to perform process automation tests.

Zip Code” field placeholder in a work item.

 

 

Messages generated by errors in regex validation. Validation happens when the cursor is removed from the field after it’s filled and also when the user tries to move to the next process activity.

 

What do you think of this feature? If you have any suggestions, please register and give us your comments.

Was this article helpful?

Related Articles