Sensitive fields & search highlighting
Two switches in the Fields module that change how a column behaves in the built app: mark a column Sensitive and its value stops being readable anywhere it is merely displayed; tick Highlight Search Results and matches are marked in the grid so a long row shows why it matched.
Marking a column sensitive
Set Sensitive on the field and choose a mask style. A passport number, a salary, a national id, a bank account. The value stays intact in the database — this changes what the application shows, not what it stores.
| Style | Looks like | Good for |
|---|---|---|
| Last 4 | ••••4567 | Account, passport and card numbers — enough to confirm the right record. |
| First letter | J•••• | Names, where you only need to tell two rows apart. |
j••••@site.com | Addresses — keeps the domain, hides the person. | |
| Hide fully | •••• | Anything that should never be partly readable. |
The mask is a fixed width apart from the last-4 tail, and a value of four characters or fewer is hidden completely. A mask that tracked the real length would leak most of what is needed to guess a short value.
Where the value is withheld
Masking only the screen would be pointless: the same value sits in exports, in search results, in filter dropdowns and in the page source. A sensitive column is therefore withheld in seven places, and every one of them was a working way to read the value before it was closed.
| Where | What happens |
|---|---|
| List & Cards | Shown masked. |
| View, Print, PDF | Masked. These pages build the value into the page directly, so they mask in their own right — a printout is the easiest way to carry a value out of the building. |
| Export | The column is not offered. A mask a download undoes is not a mask. |
| Search | The column is not searched — otherwise “does any record contain 1234?” answers exactly the question the mask refuses. |
| Filter panel | No filter is generated. A filter dropdown lists distinct values, printing in full the column you masked. |
| Inline edit | The column is not editable in the grid — an inline editor has to load the true value to edit it. Add and Edit forms are unaffected. |
| Page source | The record published to page scripts carries the mask, not the value. |
If you script the page
Each row publishes its record so client code can read it. For a sensitive column that record now carries the masked string — the same thing the screen shows — so a masked cell can never sit beside an attribute holding the real value.
// A sensitive column reads back masked, not raw:
var row = pp.grid.rowData(0);
console.log(row.pp_no); // "••••4567" — not "N1234567"
If server-side logic genuinely needs the real value, read it on the server from the record, where page permissions and row-level security still apply — not from the page.
Sensitive marking vs Field Encryption
They solve different problems and work together.
| Protects | Against | |
|---|---|---|
| Sensitive (Fields) | The value in use — screen, exports, search, page source. | Casual reading by people who legitimately use the app. |
| Field Encryption (Security) | The value at rest — it is unreadable in the database. | A stolen database or backup. |
Encrypt what must survive a breach; mask what staff should not casually read. Nothing stops you doing both on the same column.
Search highlighting
Tick Highlight Search Results on a field's Search settings and, whenever a search is running, matching
text in that column is wrapped in a <mark> tinted from your theme.
| Rule | Reason |
|---|---|
| Only while a search is active | Nothing is marked on an unfiltered list. |
| Only on the columns you tick | Highlighting everything turns the page into noise. |
| Not inside rich cell content | The term is escaped and a cell holding markup is left alone rather than risk breaking a link or an image. |
| Never on a sensitive column | Marking a match inside a mask would confirm the hidden value one character at a time. |