Flexible Queries with Nested Property
Working with nested fields
Introduction
If you have a JSON or BigQuery Struct type, e.g., user_properties and event_params for Firebase data) field in your data model, Nested Property
feature can expose the internal properties of these fields to be used in Filter, Breakdown or Function . This is especially useful to experiment with some new data captured on the fly.
Though keep in mind that using Nested Property
requires some technical knowledge and analyses may not perform as quickly as when properties are exposed as first-class fields.
Requirements to use Nested Fields
- The Nested Property feature is only available to Kubit Enterprise customers.
- Technical knowledge of the internal data structure of the JSON or Struct field.
- For advanced users, knowledge of JSON Path for JSON field.
How to use a Nested Field
- Select a Nested Field in Filter, Breakdown or Function Property. Kubit will denote a Nested Field using [:] before the field name.
- Click into the Field to expand the JSON top-level keys available.
- We will auto cast most fields to
STRING
data types - If you need to change the data type hover over the JSON top-level key you want to select and change the data type via the dropdown.
- We will auto cast most fields to

- Once you've selected the JSON Key you want to use select your operator (if using as a filter) or continue building and execute your report.
Using Nested Fields as Filters
Kubit will populate each top-level Key value with the most popular values for easier filtering.

What if the list of values for my field is out of date or stale? If the list of values is stale or needs to be updated, use our Event Field Value refresh button. You can find it at the bottom of the field value dropdown in the filter widget.

Advanced Use Cases for Nested Fields
If you need to step through multiple levels of a JSON field you're able to type in the path you want Kubit to traverse in your field.
Depending on your Cloud Data Warehouse this syntax may be different but here is an example in BigQuery:
I have a JSON field called 'Device Properties' but I need to retrieve the value from the second level of the JSON called 'state' which is inside the 'locale' key. I will type locale.state[1] to retrieve the value in the 2nd position of the state array within this object.
Here are more generic steps you can follow:
- Navigate to your JSON field
- Hover over the Field name and you will see the option to select a Custom JSON Path in the right hand panel.
- Type in your JSON path and, if necessary, specify the location within an Array you'd like to retrieve.
- Our JSON Nested Field feature will only retrieve one value from the field.
- Select the data type
- If using as a filter, select your filter operator and hardcode the value.
- Because these aren't categorized using our Event Field Value refresh you will have to manually enter the value you want to filter by.

Updated about 6 hours ago