Skip to main content
Restricts which fields can be queried in the topic. By default, all fields from the base view and joined views are included.

Behavior

The fields directive enforces restrictions at query runtime, not just in the field picker UI. Queries attempting to use fields excluded by this directive (or fields that depend on excluded fields) will return an error.

Syntax

Properties

fields
string[]
An array of field selectors that determine which fields are available in the topic. Supports the following operators:Omni will evaluate the operators according to the Order of operations value in the above table. This means all_views is evaluated first, then specific views, and so on. This allows you to exclude views and then add specific fields back in.
To exclude a view, tag, or field, prefix the clause with a -. For example: -users.*

Examples

Only include the users view
Exclude the users view
Exclude only the users.id field
Exclude fields with the pii tag
Add the user_facts.lifetime_value back in after excluding the user_facts view
Remove the users.acquisition_cost field from the fields targeted by the marketing tag
Include only marketing-tagged fields from the internal__workspaces view
Exclude PII-tagged fields from the users view
Exclude an entire view but re-include specific tagged fields from that view