Skip to content
  • There are no suggestions because the search field is empty.

How-To: Query and Transform JSON using JSONata via an external Node.js library

What Does This Article Cover?

  • What is a JSONata?
  • How to set it up?
  • Configuration
  • Example Video
  • Other Related Material


What is a JSONata?

JSONata is a query and transformation language for JSON data sets.  Instead of having to write JavaScript to query and transform the data, JSONata can be used instead.   JSONata is similar to XSLTs used for XML and SQL used for databases to pull data from data sets and transform them that can get the data you need using single expression.

 

How to set it up?

The setting of the GUI interval uses a third party npm libraries "jsonata" and "run-async".  Downloading and installing Node.js and npm is covered here.  Follow these steps to import your npm library:

  • Enable expression-imports on the Settings page.
  • This will create a /appData/expression-imports folder
  • Open a command window.   Navigate to the expressions-imports folder and run the following command to install the npm packages.  This command will install the jsonata and run-async packages.
npm install jsonata run-async

 

Configuration

Here is a download for the configuration used in this article.   Download the configuration and import it into Intelligence Hub. 

To use the JSONataNamespaceBuilder pipeline, the Token on the ProjectAPI connection needs to be updated to use a valid API key.   See API Keys

Configuration

In addition, here is the Postman Collection used to call the HighByte Data Server in this article.

Postman Collection

 

Examples Video

Here is a video that shows various examples of how to use JSONata in HighByte Intelligence Hub.

 

Other Related Material: