Windward DocumentationReport Designer Office Edition User Manual FAQsHow Do I Create a Select Statement With the JsonPath Wizard?

How Do I Create a Select Statement With the JsonPath Wizard?

In this article, we'll go step by step through an example of using the JsonPath Wizard to create a select statement for a ForEach Tag. If you aren't familiar with the ForEach Tag, please review our ForEach Tag Reference before continuing.

In this example we'll create a table of products whose unit price is greater than $50, sorted by the number of units in stock. You can begin with a blank Word document, or follow along with the attached example template that uses our public Northwind JSON data source.

Six Steps to Using the JsonPath Wizard

Although this example is specific to a ForEach Tag, this procedure can be followed to create a JsonPath select statement for any Tag returning data from a JSON data source.

  1. Create the Tag where the select statement will be applied
  2. Bring up the JsonPath Wizard
  3. Select the node you wish to display data about in your output
  4. Create a condition the data must satisfy to be displayed
  5. Sort the data satisfying the condition (optional)
  6. Generate output

Create the Tag Where the Select Statement Will be Applied

We've opened a Word document and connected to our example Northwind JSON data source (located at We create a table displaying product ID, product name, unit price and units in stock by dragging the "Products" node from the Data Bin and dropping it onto the report template.

This creates a table containing a ForEach Tag and some Out Tags. We'll use the JsonPath Wizard to modify the select statement in the ForEach Tag. You can format the Out Tags' output as desired (e.g. set the UnitPrice Out Tag output format to Currency).

Bring Up the JsonPath Wizard

To bring up the JsonPath Wizard on the ForEach Tag, select the ForEach Tag, then click on the Wizard button on the AutoTag tab of the Word ribbon.

Select the Node You Wish to Display Data About in Your Output

Since we created the ForEach Tag by dragging and dropping from the Data Bin, the node we wish to query is already selected. If we had inserted the ForEach Tag manually, we would click on "click here to add a node", then use the popup window to select the node we wish to query.

Create a Condition the Data Must Satisfy to Be Displayed

We want to display those products whose unit price is greater than $50. To do so we must create a condition. A condition is a node, a comparison and a value, such as "unit price > 50."


Then click on "click here to enter a condition":

Next, click on "click here to select a node", then select the UnitPrice node in the popup window:



Sort the Data Satisfying the Condition (Optional)

Now we have a select statement which will return the ID for each product with a unit price greater than $50. To sort those product IDs by units in stock, click on "Click here to add an order by":

Click on "ascending", change it to "descending", then click on "OK":


Generate Output
