Masks

You can apply masks to phone number and postal code fields to ensure that users enter these numbers in the appropriate format.

For example, your agency might want to require users to include their country code with their phone number, or to require users to enter phone numbers as 888.555.1212 rather than 888-555-1212. If a user attempts to enter a number in another format, Civic Platform delivers an error message and asks them to reenter the number.

When creating masks, enter “0”s or “#”s in the positions where you want Civic Platform to accept any number or character. Civic Platform requires users to enter all characters in the expected format and position.

For example, to create a format that forces users to enter a phone number in the format (800) 555-1212 x.555, enter (000)000-0000 x.###.

Using the sequence generator you can define masks for numbered items. A mask in Civic Platform determines how a number displays to a user. For example, each new permit number might have a prefix indicating the type of permit and a date code in addition to the incremental number. A citation number can have a prefix that identifies it as a citation and not a permit, receipt number, or other incremental record in Civic Platform. After the initial implementation, you rarely need to modify masks.

When creating the pattern of the mask, be certain that you include the interval type within the sequence number. By including the interval type in the pattern ensures uniqueness. Without the interval type, you might introduce duplicates.

Mask definitions can only reference a single sequence definition. You can have many mask definitions that point to the same sequence definition. This way, you can have multiple masks using the same number pool.

For example, you might want to use a single number pool for all of the application types for the building module but have the mask display different information with that number. For example: you could name your record ID Sequence Definition “Building” and then your mask definitions “Building-Residential” and “Building-Commercial” could reference Sequence Definition Building.

A mask pattern consists of a combination of variable substitutions and literal text. A pattern has one sequence number variable you can place anywhere in the pattern. All variables can appear in any position of the mask pattern. Enclose all variables in “$$” delimiters.

For example, you write a sequence number variable as $$SEQ08$$.

A mask might contain CIT to indicate that the number is a citation number. This section details the various items that you can include in the pattern.

Sequence mask patterns return results in all uppercase.

All variable names are case-sensitive. For example $$MM$$ represents month data but $$mm$$ represents minutes data.

For the basic building blocks of masks, refer to the Example mask patterns table.

The date patterns can represent year, month, day, day of year, hour, day of month, day of week. For a list of all mask pattern possibilities, refer to the Common date formats table.

With pattern masks, you can represent numbers as Base 10 (meaning each digit can be 0-9) or Base 36 (meaning each digit can be 0-9 or A-Z).

For example, you can represent over 60 million different Record Keys from the same number pool (sequence interval) without conflict.
Name Pattern
Example record key pattern $$yy$$BLD-00000-$$SEQ05$$ with a base of 36
Corresponding record ID pattern $$yy$$BLD-$$SEQ08$$ with a base of 10