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, so a query that attempts to use an excluded field will return an error. A field that references an excluded field can be queried if it’s included in the topic. For example, you may choose to exclude a dimension called sales but include a measure that aggregates it called sum_sales.

Syntax

Properties

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