Feature Alert Aug’17: JSONata – new powerful transformation language for building complex workflows

Olga Annenko feature-alert

JSONata_With function 2

Last time we gave you a glimpse at JSONata – a new expression and transformation language that makes it possible even for non-coders to create rather complex workflow scenarios, when a certain message needs to be routed to only a specific system based on its content.

But we were not going to stop there. The benefits and capabilities of this new language are huge, that is why as of August, you can now use JSONata as a standard expression and transformation language on the elastic.io integration platform

Wait, what is JSONata?

JSONata is a powerful open-source language for querying and transforming JSON. It helps extract specific meaningful data from it using a relatively simple logic that somewhat resembles the one used in Excel.

What it can do:

The main beauty of the JSONata for the user of elastic.io is that now it is possible to perform complex transformations while being in the process of mapping the systems and actually see whether you’re doing it the right way.

Imagine you have an order with several items and you need to calculate an average price or a total price; or you have only brutto amount and you need to get netto amount as a result of your integration.

With JSONata being now the transformation language of our mapper, such data transformations become a matter of several minutes. Plus you will be able to literally watch in real-time how your data transforms according to your conditions.

JSONata brings so many possibilities that are otherwise doable only with some pretty heavy coding.

  • You can remove a currency acronym from a price if the only thing you are interested in is a number
  • You can combine and aggregate numerical data, e.g. multiply the product price by product quantity and then get the total sum of all that
  • You can split the strings, e.g. the field “Full name” into “First name” and “Last name”, with only a few keystrokes
  • You can even strip an email address (provided its spelling meets the specific conditions) down to only “First name” and “Last name”…

JSONata example

  • …and so much more.

What has changed: Data Mapper 2.0

The major change invoked by the introduction of JSONata is that complex workflows can now be done not only by developers, but also by the so called citizen integrators – salespeople, marketers, HR people, etc. – without the need for custom code. The logic of JSONata – though being different to the one used in Excel by any line-of-business manager -, is yet similar to it in its logic and is, therefore, easy to learn and to use.

In addition to that, the library of JSONata expressions is inbuilt within the mapper, so that the users can look up and select an expression from a drop-down menu of most common expressions like SUM, SPLIT, AVERAGE, CONCATENATE, and so on.

JSONata_With function 2

They can even modify the common transformation expressions after the selection manually if anything needs some specific adjustment.

Next, however complex the desired transformation of the data is, the users receive the validation of their expressions on the go straight in the mapper. With JSONata, the transformation of data on the elastic.io becomes truly “What You See Is What You Get”.

And good news for developers: They can also add their own, custom transformation expressions to their JSONata library, in case they deal with certain very specific transformations on a regular basis, for which there is no suitable expression in the JSONata public library yet.

Summing up:

JSONata introduced an absolutely new way of setting up complex data transformations, conditionals and other necessary functions for workflows, both simple and advanced. This fantastic query language has increased the expressiveness of the elastic.io integration flow designer and improved its UX/UI. It has also allowed to speed up the reaction of the designer to changes in the workflow: Now, instead of checking every change with the “Test this step” function, the user sees the feedback to his changes right in the browser.

Important notes:

1 Old flows stay backwards compatible and won’t be automatically upgraded, but they will work the same way as they used to. All new flows created after the introduction of JSONata will support only the JSONata query language.

2 JSONata mapper does not split any incoming arrays. If your integration flow logic requires splitting of the incoming array, you will need to select the special Splitter component first. If the Splitter component is not used, your arrays will be passed as they are to the next step.NOTE: For more specific details on how to use the Splitter component and what else you can do with arrays, please refer to the page ‘Array splitting and JSONata mapper‘ in our documentation.

What to expect in the coming weeks:

This month, our guys will continue working on improving the Local Agent – the part of the elastic.io iPaaS that allows tying together multiple SaaS products with on-premise systems and databases.

In addition to that, we are going to update several integration components, for example, the longed-for SugarCRM components. And we are going to add several new components, thus further extending our own integration components library.

Stay tuned for more info.

In the meantime, why don’t you check out the Data Mapper 2.0 with JSONata;-)

Request Live Product Tour

About the Author

Olga Annenko


Olga Annenko is a tech enthusiast and marketing professional. She loves to write about data and application integration, API economy, cloud technology, and how all that can be combined to drive companies' digital transformation.

You might want to check out also these posts