Assigning generators to path expressions
On Collection View and Document View, Structural can automatically assign generators to fields that match a configured path expression. Each collection or JSON column has its own set of path generators.
Structural always applies the path generator to matching fields that do not have an assigned generator (are set to Passthrough).
Structural does not apply the path generator to matching fields that have a generator configuration applied directly.
However, in a child workspace, Structural does apply the path generator to matching fields that inherit their current generator configuration from the parent workspace.
Displaying the list of path generators
To display the list of path generators for the current collection or JSON column, click Path Generators.
For each path generator, the list includes:

The priority order. Structural checks the fields against the paths in the order that the paths are displayed. The first matching path wins.
The path expression to identify matching fields.
The data type filter for matching fields. You can configure a path generator to only apply to fields of a specific type or types.
The name of the generator preset that Structural applies to matching fields.
Creating a path generator
To create a path generator, you can either create a completely new path generator, or start from a duplicate of an existing path generator.
Structural saves the new generator automatically when the configuration is complete. The Saved button at the bottom right indicates when the generator is saved.

Creating a completely new path generator
To create a path generator:
On the path generators panel, click Add path generator.
On the path generator details panel, in the Path Expression field, provide the path expression to use to identify matching paths. The path expression uses the JSONPath syntax. Note that for a path generator, you cannot use the expression to check for a field value. For more information about the supported operators and some examples, go to Supported JSONPath operators and examples. When you provide a path expression, the matching fields list displays the fields that match the expression.
You can optionally filter the matching fields based on the data type. For example, you might only want to apply a generator to text or integer fields. By default, the data type filter list is empty. The available data types are general types that map to specific data types in a given database. Under Data Types, to add a data type to the filter, select it from the dropdown list. To remove a data type, click its delete icon. When you configure data type filters, the matching fields list is updated to only include fields that have one of the specified data types.
From the generator dropdown list, select the generator to apply to matching fields. The available generators are affected by the data type filter. When the data type filter is empty, you can only select from generators that can be used for any type of column. When you specify a list of data types, you can only select from generators that can be used for all of those data types.
Configure the selected generator. For a generator assigned to a path expression:
Linking is not supported.
Consistency with other columns is not supported.
Copying an existing path generator
You can create a path generator based on an existing one. For example, for the same path expression, you might want to assign a different generator based on the data type.
To create a new path generator based on an existing path generator:
On the path generators list, click the options menu for the path generator to copy.

Click Duplicate path generator.
On the path generator details panel, edit the configuration.
Updating a path generator
To update a path generator:
On the path generators list, click the options menu for the path generator.
Click Edit path generator.
On the path generator details panel, edit the configuration.
Structural saves the changes automatically.
For fields that were assigned a generator based on the previous configuration, but that do not match the updated path generator configuration:
If the field matches other path generators, then the next matching configuration is applied.
If the field does not match any other path generators, then the field reverts to Passthrough.
Deleting a path generator
When you delete a path generator, the generator assignment is removed from the matching fields. If a field matched more than one path generator, then the next match is used.
To delete a path configuration:
On the path generators list, click the options menu for the path configuration.
Click Delete path generator.
For fields that were assigned a generator based on the path generator:
If the field matches other path generators, then the next matching path generator is applied.
If the field does not match any other path generators, then the field reverts to Passthrough.
Supported JSONPath operators and examples
For a path generator path expression, Structural supports the following operators:
$
- Root.
- Child operator..
- Recursive descent operator*
- Wildcard operator[*]
- Array operator. Note that a path generator must always target all of the items in an array. Any use of the array operator must include the wildcard operator.
For example, a document includes an array of objects. Each object contains name, address, and email address fields.
{
[
{
"name": "John Smith",
"address": "1 Main Street",
"email_address": "[email protected]"
},
{
"name": "Mary Jones",
"address": "5 Elm Avenue",
"email_address": "[email protected]"
},
]
}
You can configure a path generator that assigns a generator to the address field in all of the array objects. You cannot only assign a generator to the address field in one of the array objects.
Here are some example path expressions, based on the following JSON:
{
"bookstore_name": "Read & Brew Books",
"mailing_address": {
"street": "123 Literary Lane",
"city": "Bookville",
"state": "MA",
"zip_code": "02451",
"country": "USA"
},
"phone_number": "555-123-4567",
"books": [
{
"title": "The Great Gatsby",
"author": "F. Scott Fitzgerald",
"isbn": "978-0743273565",
"publication_year": 1925,
"country": "USA"
},
{
"title": "Moby Dick",
"author": "Herman Melville",
"isbn": "978-1503280786",
"publication_year": 1851,
"country": "USA"
},
{
"title": "To the Lighthouse",
"author": "Virginia Woolf",
"isbn": "978-0156907392",
"publication_year": 1927,
"country": "UK"
},
{
"title": "The Catcher in the Rye",
"author": "J.D. Salinger",
"isbn": "978-0316769174",
"publication_year": 1951,
"country": "USA"
}
]
}
$.bookstore_name
Find the bookstore_name
field at the top level of the JSON.
$.mailing_address.zip_code
Find the zip_code
field in the mailing address.
$.books[*].isbn
Find the isbn field in each entry in the array of books.
$..country
Find all country
fields in the JSON.
Determining the priority order for the path generators
When Structural looks for matching fields, it checks the path generators in the order that they are displayed on the Path Generators panel.
For each field, it uses the first matching configuration.
To change the order of the path generators, drag and drop each configuration to the appropriate location in the list.
Identifying matching fields on Collection View and Document View
On Collection View and Document View, when the assigned generator comes from a path generator, the generator assignment is marked with an icon.

When you click the generator, the configuration panel indicates that the generator is assigned based on a path generator.

Overriding the path generator assignment
When you change the configuration, the panel indicates that the current configuration overrides the path generator.
To override the path generator configuration, click Override path generator. On the generator configuration panel, update the generator configuration.
Note that you cannot override the generator to Passthrough. If you set the generator to Passthrough, then the field reverts to the path generator.
Last updated
Was this helpful?