PPPHP

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.

WhereConsole → project → Fields → the Sensitive column, and a field’s Search pill → Highlight Search ResultsPHP

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.

StyleLooks likeGood for
Last 4••••4567Account, passport and card numbers — enough to confirm the right record.
First letterJ••••Names, where you only need to tell two rows apart.
Emailj••••@site.comAddresses — 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.

WhereWhat happens
List & CardsShown masked.
View, Print, PDFMasked. 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.
ExportThe column is not offered. A mask a download undoes is not a mask.
SearchThe column is not searched — otherwise “does any record contain 1234?” answers exactly the question the mask refuses.
Filter panelNo filter is generated. A filter dropdown lists distinct values, printing in full the column you masked.
Inline editThe 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 sourceThe 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.

WhereEvents → any list page → JavaScriptJS
// 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.

ProtectsAgainst
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.

RuleReason
Only while a search is activeNothing is marked on an unfiltered list.
Only on the columns you tickHighlighting everything turns the page into noise.
Not inside rich cell contentThe term is escaped and a cell holding markup is left alone rather than risk breaking a link or an image.
Never on a sensitive columnMarking a match inside a mask would confirm the hidden value one character at a time.
Rebuild after changing either switch. Sensitivity and highlighting are baked into the generated pages, so the running app keeps its previous behaviour until the project is built again.
Masking is not a substitute for permissions. If a role should not see a record at all, use page permissions or row-level security. Masking is for values that the right people may hold in front of them but should not be able to read, copy or export in bulk.