Skip to content

Docs: formula output on reference-typed properties is silently coerced to string #8

Description

@mitselek

TL;DR

A property declared type: reference with a formula produces string output, not a reference value. The declared type: reference is silently ignored.

Reproduction (probed 2026-05-18 against api.entu.app/polyphony)

  1. Create temp entity type with property: { name: ref_via_formula, type: reference, formula: _parent }
  2. Create a parent entity (any type)
  3. Create an instance of the temp type under that parent
  4. GET the instance

Returns:

"ref_via_formula": [
  { "string": "<parent's name>" }
]

No reference key — value is stored as string regardless of the declared type: reference.

Source

entu/api/utils/formula.js — the formula() function only returns { string: X } or { number: X }. No { reference: X } output path exists.

Implication

Apps designing on Entu can't expect formula-populated reference properties to behave as refs. They should declare formula-bearing properties as type: string for honest schema, or accept the type-vs-output mismatch.

Suggested doc note

At https://www.entu.ee/api/formulas/ (or properties config docs): add a note that formula output is always string or number; declaring type: reference on a formula property is silently ignored.

Related: polyphony case study D3 — https://github.com/entu/research/blob/main/docs/case-studies/2026-05-polyphony-on-entu.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions