Mask: standardize references with different formats
The Mask column type applies an input mask to linked data: each value in a reference table carries its own formatting rule, and a formula automatically applies the right rule to the entry.
Use it to bring inconsistent references into a single format.
Three different things carry the word « mask » in TimeTonic. The Mask column, described here, standardizes an input format. The APPLY_MASK() function is the formula that applies the mask. The Encrypted field is unrelated: it is a protection mechanism. See the last section of this article.
The Mask column is created like any other column type, from the field creation window.
The use case
I have a set of heater models. References do not follow the same logic from one model to another, and I want to bring them all to the same 4 character format.
The part to keep is therefore not the same depending on the model.
Model
Reference length
What I want to keep
Model 1
8 characters
The last 4.
Model 2
10 characters
The first 4.
Model 3
6 characters
Everything except the first and last character.
Model 4
6 characters
The first two, the 4th and the 5th.
Setting it up
The mechanism relies on two tables: a reference table that carries the masks, and an input table that applies them.
1. The selection table, which carries the mask
1
List your models
One row per model, in a text column (here Type).
2
Create the Mask column
In that same selection table.
3
Fill in the mask rule next to each model
One rule per row, matching what you want to keep for that model.
The mask only accepts two characters.@ displays the original character, X or x hides it (the position is simply omitted from the result, not replaced by a symbol). Any other character, including a space, invalidates the mask and returns an empty value: no separators inside the mask.
2. The input table, which applies the mask
1
Create a Select (list from another table) column
Pointing to the selection table, and based on the column that carries your models (here Type).
2
Create a Text column
This is the field where the model reference is entered manually.
3
Create a Formula column and select APPLY_MASK
This is the one that will display the standardized reference.
The formula is built as follows, the value first, the mask second:
APPLY_MASK($manual_entry_column, $select_column)
In our case:
APPLY_MASK($Input reference, $Pattern)
Calling parameters in TimeTonic: $field_name for a field (link, linked table column, number, select, formula, text); "free text" between quotation marks; no quotation marks for numbers. Typing $ in the editor immediately displays the list of available fields.
The formula retrieves the mask associated with the selected model and applies it to the reference entered. Your data is standardized to the same format, whatever the row.
Formatting data, or protecting it?
A mask changes what is displayed, not what is stored: the original column still holds the full value and remains readable.
If your goal is confidentiality rather than formatting, this is not the right mechanism, or not the only one.
What you need
The mechanism
Bring references into a single format
The Mask column, described in this article.
Display only part of a sensitive value
APPLY_MASK() with a fixed mask, combined with an access restriction on the original column. Without that restriction, the mask protects nothing.
Store a secret that nobody should read
The Encrypted field: the data is encrypted, including server side, and protected by a dedicated password.
Go further
APPLY_MASK()
The full mask syntax, with a fixed mask written directly in the formula.