Set Entity Type Field Formula
Set how an entity type field gets its value. value_source COMPUTED with formula makes the formula own the value: callers can no longer write it, it reruns whenever a field it reads changes, and saving it recomputes every existing entity in the background, overwriting entered values (an empty result clears them). AUTO_NUMBER with auto_number numbers every entity, existing ones without a value included, as prefix plus a zero-padded counter; only TEXT and UNIQUE fields can be auto-numbered. ENTERED makes the field writable again, keeping the last values; add default_formula to fill it on create when the caller leaves it empty. Call on the field ID of the type that defines the field, not a child type that inherits it. Fields used by an ingestion mapping or a normalization rule, the key field of an ingested type, and formulas that read a sensitive field into a non-sensitive one are refused. Check a formula first with Preview Entity Type Field Formula, and follow the recompute with Get Entity Type Field Formula Status. Formulas are CEL over the entity’s own fields, each named by its key with hyphens written as underscores (item-cost is item_cost). An empty field is null: test it with has(x) or supply a fallback with x.orValue(d). A single-target ENTITY_REF field reads one level through the reference (owner.email); an ENUM field reads as . Functions: join_nonempty(sep, list), round(x), round(x, digits), string, today(), days_between(a, b), lower, upper, the ? : operator, and the exists and all macros. A computed field may read another computed field only when that one reads none, cycles are refused, and a formula reads at most 10 referenced fields. FILE and MULTI_SELECT fields cannot be read or produced.
Authentication and permissions
Token requirements: User-based token (OAuth) or Organization-scoped API key or Team-scoped API key. Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.
- Change how a field in a team’s database gets its value: The permission is checked on the team that owns the field’s database. A caller admitted to the database only through a share cannot change its formulas.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the entity type field on the type that defines it. A field a type inherits takes its formula from the parent's placement.
Body
ENTERED (callers write the value), COMPUTED (formula owns the value) or AUTO_NUMBER (a counter numbers each record).
FIELD_VALUE_SOURCE_UNSPECIFIED, FIELD_VALUE_SOURCE_ENTERED, FIELD_VALUE_SOURCE_COMPUTED, FIELD_VALUE_SOURCE_AUTO_NUMBER The formula. Required when value_source is COMPUTED; refused otherwise.
A formula that fills the field on create when the caller leaves it empty. ENTERED only; omit to clear the field's default.
How an auto-numbered field builds its values: the prefix followed by the next number, zero-padded to digits.
Response
Success
The field as saved.

