20.0.0 JPath Wizard Reference
The JsonPath Wizard is a user interface that allows users to build JsonPath (or JPath) statements without needing to know how to code JPath. JPath is a query language that allows the traversal of a JSON structure with XPath-like navigation.
This article will introduce you to the Wizard. For a detailed example that uses the Wizard, see How Do I Create a Select Statement With the JPath Wizard?
The JPath Wizard Interface
The Wizard is comprised of three panes: the Conditions Pane; the Data Pane and the Select Statement Pane.
The Conditions Pane is where you create the conditions that will be applied to the data. A condition is made up of a node, a comparison and a value. You can see those three elements labeled in the screenshot below.
- The root node is the JSON node you first selected and to which the conditions you create are applied. It is good practice to select the highest node possible in order to return as much data as you need. Then you can use conditions and additional nodes to filter the data you want returned later.
- The node (or subnode) is the data you wish to satisfy a condition. In this example's data source, the node contains the employees' titles.
- The comparison is a drop-down list whose options are equal to, not equal to, greater than and less than. In this example, we chose the comparison equal to.
- The value is what the data in the node will be compared to. In this example, we chose the value "Sales Representative."
The Results Pane is a graphical view of the nodes returned by the select statement you create - it is updated in real time as you change the select statement.
Select Statement Pane
The Select Statement Pane shows the select statement created by the condition. When you click OK to close the Wizard, this is the text you will see in the Query Pane of the Tag Editor.
You may create multiple conditions within the Wizard. If you do so, the Wizard gives you the option of determining whether all or any of the conditions must be met.
Search Data Tree
To search the data tree for a node, click on "click here to add a node" to open the search window:
The search bar can be used to find nodes in your database faster. The search can be global (across the entire database), or it can be focused on a specific table within the database. To search within a specific table, locate said table and click on it (make sure its selected), then conduct the search.
- A general search will return multiple nodes. For example, if "name" is searched, the "LastName", "FirstName" and any other column that has "Name" in it's name are returned.
- If a case sensitive search is preferred, check the "Match Case" checkbox.
To cycle through the results of the search, use the down arrow button located next to the search box (or ENTER key) to go to the next column, and use the up arrow button (or SHIFT+ENTER) to cycle back through the results.
One last note – the Wizard is called the "JsonPath Wizard" instead of the "JSON Wizard" because JPath is a query language used for finding information in a JSON data source. If you would like to learn more about how to build JPath select statements, this website is a great reference.