App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Applicationintegration
#App Connect
#AppConnect
 View Only

Node-RED embeds JSONata as its expression language 

Thu July 09, 2020 03:11 PM

Adobe Spark(13)


The latest 0.16 release of the open-source IoT power tool, Node-RED, now includes the ability to query and transform its JSON payloads using the JSONata expression language.

Node-RED has gained wide adoption amongst the IoT community owing to its simple visual programming model, allowing data flows to be wired together and configured graphically. This enables its users to connect sensors to backend databases, hook into social media, create html dashboards, all without writing a line of code. When the user wants to modify the data, then a ‘function node’ is available to add custom code. Here is where the underlying JavaScript engine shows through. The user must write low-level JavaScript code to make this work. Very powerful, but not so accessible to non-programmers.

The latest release makes this substantially easier with the introduction of the ‘expression’ option on two of the most commonly used nodes – ‘change’ and ‘switch’. These nodes can now be configured with the powerful and easy to learn expression syntax, JSONata, that supports sophisticated data queries and modification.

JSONata is an open-source project developed by IBM that provides simple yet highly capable query language for JSON data.

JSONata is also core to the graphical mapping engine in IBM Cloud App Connect which is a radically easy to use integration tool that connects your apps both in cloud and on-premises. App Connect is built largely from open source technologies like Node, loopback, Kafka and JSONata. It provides a rich set of out-of-the-box connectors to industry leading SaaS and enterprise applications and uses JSONata to provide the expression syntax that allows users to create sophisticated transformation logic to simplify automation of manual tasks.

Visit appconnect.ibmcloud.com, jsonata.org and nodered.org to find out more.

4 comments on"Node-RED embeds JSONata as its expression language"

  1. Phil March 29, 2017

    It’s missing some important JSONATA functions like:
    $contains(str, pattern)
    $match(str, pattern [, limit])
    $replace(str, pattern, replacement [, limit])
    so the title should be:
    “Node-RED embeds SOME JSONata as its expression language”
    BTW, how do you re-activate the missing functions?

    Reply (Edit)
    • Andrew J Coleman March 29, 2017

      Hi Phil, thanks for the comment. At the time of writing this article, the latest version of JSONata was 1.0.10 and it is this that was embedded in Node-RED 0.16. The missing functions that you mention were introduced in JSONata 1.1 (see https://developer.ibm.com/open/2017/02/28/announcing-jsonata-v1-1/). The next version of Node-RED will use this updated version.

      In the meantime you can pull down and build the 0.17 branch of Node-RED from github (https://github.com/node-red/node-red/tree/0.17) which embeds the latest version of JSONata.

      Reply (Edit)
      • phil March 30, 2017

        Thanks Andrew for clarification. I cannot edit my message (comment is different from ibmid).
        Jsonata is great and I love node-red. Keep up these mass market changers.

        Reply (Edit)
  2. Amar February 07, 2017

    Good one best article

    Reply (Edit)

Statistics
0 Favorited
12 Views
0 Files
0 Shares
0 Downloads
Global message icon