Local variables silently override field values when their name matches a field's internal ID (Ninox 4, reproducible)
Hi
A script variable whose name matches a field's internal ID (A, B, C…) silently replaces that field's value. This happens case-insensitively, for direct field access AND for access through a record (rr.field). No error, no warning.
Minimal reproduction (Ninox 4, web, Builder mode):
1. New database, table "test".
2. Create 12 Number fields in this order: f01, f02 … f12 (internal IDs A … L).
3. Create 1 record with values 1 … 12.
4. Add a formula field "check":
let A := 1001; let B := 1002; let C := 1003; let D := 1004;
let E := 1005; let F := 1006; let G := 1007; let H := 1008;
let I := 1009; let J := 1010; let K := 1011; let l := 1012;
let rr := record(test, 1);
"Direct: " + join([text(f01), text(f02), … text(f12)], " ") +
" | Via record: " + join([text(rr.f01), text(rr.f02), … text(rr.f12)], " ")
Expected:
Direct: 1 2 3 … 12 | Via record: 1 2 3 … 12
Actual:
Direct: 1001 1002 … 1012 | Via record: 1001 1002 … 1012 (screenshot 1)
Note: the last variable is lowercase (let l), and field f12 (ID "L") still returns 1012 → the collision is case-insensitive.
Even more telling: after saving, the editor itself rewrites the field references. text(f01) becomes text(A), and rr.f12 becomes rr.l (screenshot 2). So field names are resolved to internal IDs, and those IDs collide with local variables.
Real-world impact: in a production app, a chart showed a constant value (70 = my layout variable "L") instead of the field ev_cum. It took hours to find, because nothing indicates the problem.
Questions:
- Is this known / intended?
- Could field references be protected from local variables, or could the editor at least show a warning when a variable name matches a field ID?
- Is there an official list of identifiers to avoid?
Workaround for others: never use single-letter variable names (or any name that could match an internal field ID).
"Environment: Ninox 4 cloud (web), Builder mode, Chrome PC and Chrome Android. Observed both in formula fields and in custom components. I can share the test database if needed."
Thanks!
Antwort
Content aside
- vor 12 StundenZuletzt aktiv
- 8Ansichten
-
1
Folge bereits
