Input Masks
Input masks provide a set format for data entry in an attribute or list of values by using characters and symbols. When you apply an input mask to a field, anyone who inputs data in that field must follow the specific pattern defined by the input mask.
Input masks are a part of the Validation rules that are set in Attributes and List of Values in the System Setup.
Note that for attributes or LOVs with the Base Validity of ISO date and ISO Date and Time you should not enter any Input Mask at all. In fact you will encounter errors if you do enter a Mask and subsequently attempt to enter a Date or Date / Time value for an attribute.
- Create attribute or LOV.
- Select the Attribute or List of Values tab.
- Click on the Edit Validation Rule link.
- Edit the Mask.
Example Input Mask Use Cases
Example | Description |
---|---|
An attribute contains values for the 5+4 U.S. zip codes. |
A pattern could be set that would require entering:
The valid value for this attribute would have to be patterned as 12345-1234. Any other pattern, such as 123-1234 or 12345 would result in an error message appearing and the entry would not be accepted. |
A LOV for an attribute contains values for a unique color code. Examples: BK (01) RD (02) Y (03) GR (04) |
The requirement for this LOV input mask are:
Thus the input mask would look something like this: L? (00) |
A GTIN attribute needs to be configured to allow for more than one type of GTIN. |
An example might be to allow for the EAN-8 or the EAN-13 to be entered. An example for this would be: 00000000|0000000000000 This mask would allow for an eight digit or a 13 digit number to be entered. The PIPE symbol (|) is added after the eighth character to indicate the 'OR' operator for the mask. |
Definitions of Input Mask Characters
The following table lists the different restrictions that may be imposed on a value through the use of an input mask. Remember, this list focuses on each of the values for an input mask. They can be combined to create a combination of patterns for an attribute or LOV.
Mask |
Description |
Input Mask Example |
---|---|---|
9 |
The corresponding character must be numeric, (0-9), a space, or an empty value. |
Input Mask: 99999 Valid values: 1, 12345, 12 45 Invalid values: 12-45, A45, +23 |
# |
The corresponding character must be one from the following set: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, <space>, -, +} |
Input Mask: ##### Valid values: 12345, -23 5, 1234+ Invalid values: AA 45, 123#5 |
? |
The corresponding character must be an alphabetic letter up to the length of the mask. Empty values are OK at the end of the entry but no spaces otherwise. |
Input Mask: ????? Valid values: ABCDE, AbCd, a Invalid values: AB12, A+, AB DE |
a |
The corresponding character may be either alpha or numeric but no special characters. Empty values are OK at the end of the entry but no spaces otherwise. |
Input Mask: aaaaa Valid values: aB123, 1234, ab1 Invalid values: AB 12, +GT |
C |
This will allow any character in the corresponding position, including spaces and empty values at the end of the entry. |
Input mask: CCCCC Valid values: ABC, ab 12, 1, +45, 23% Invalid values: 123456 as the last digit exceeds the limit of the mask. |
& |
This will allow any character in the corresponding position, including spaces but no empty values at the end of the entry. |
Input mask: &&&&& Valid values: 123ab, 12 AB, -1Xy% Invalid values: 123, abcd |
L |
The corresponding character must be an alphabetic letter up to the length of the mask. No spaces or empty values at the end of the entry are permitted. |
Input mask: LLLLL Valid values: ABcDE, ABCDE, abcde Invalid values: ABC, AB123, +abcd |
A |
The corresponding character may be either alpha or numeric but no special characters or spaces and no empty values at the end of the entry. |
Input mask: AAAAA Valid values: abcde, a1b2c, 12345 Invalid values: B1, ab de, 45% |
0 |
The corresponding character must be numeric, (0-9), with no spaces or empty values. |
Input mask: 00000 Valid values: 12345 Invalid values: 12, 12 34, 12abc |
Static Mask Characters
If other characters are typed into the mask besides the ones mentioned above, then the value must match that character exactly and it cannot be omitted.
For example, in reference to the mask 'T-99', the 'T' and the '-' are always required to be entered but the '99' are masks for optional number per the definition in the table above. This means that the values T-1 and T-12 would be valid values but the values R-12 or T=1 would not be valid values.
If the static mask requires the usage of one of the mask characters mentioned in the mask character table above, it is possible to release or 'escape' the character rules by typing a '\' in front of the character. For example, if you wanted a static mask like 'TOC-09' meaning a static prefix of 'TOC-' followed by a required number '0' followed by an optional number '9', the 'C' would allow any character to be entered under the mask rules for 'C'. However, by entering the'\' in front of the 'C' as shown in the image below, the 'C' no longer follows the mask rules and would require the 'C' be entered as a valid value.