start portlet menu bar

HCLSoftware: Fueling the Digital+ Economy

Display portlet menu
end portlet menu bar
Close
Select Page
Contents
Table of Figures
Introduction Figure 1: Job definition page
Exploring JSONata Figure 2: Action page
Simplify Data Manipulation with the JSONata Plugin Figure 3: Submitting job
Action Figure 4: Monitor page
Submitting Your Job Figure 5: Job Log
Monitor Page Figure 6: Output properties
Job Log  
Output Properties  
Conclusion  

Introduction

Today’s data-driven society places a premium on the ability to extract, modify, and manage JSON data, which is essential for effective corporate operations. The JSONata Plugin can help users in this situation by enabling JSON querying and manipulation within Workload Automation workflows.

Exploring JSONata

Before introducing the plugin, let’s take a quick look at JSONata.

JSONata is a potent query and transformation language created especially for use with JSON data. JSONata is a flexible and effective tool for extracting, manipulating, and transforming data in JSON format because of its clear syntax and expressive features. Whether you’re working with intricate nested structures or enormous JSON databases, JSONata makes it easier to query and transform the data – which frees you to focus on drawing insightful conclusions from it.

Suppose we have the following sample JSON:

Using JSONata, we can perform various queries to extract the desired information. For example, we can use the following query to get the names of employees:

$.employees.name

This query returns an array with the names of employees:

[“John”, “Emily”, “Michael”]

We can also filter employees based on age using a query like this:

$.employees[age > 30]

This query returns an array of objects that include only employees above the age of 30:

[
{
“name”: “John”,
“age”: 32,
“department”: “IT”
},
{
“name”: “Michael”,
“age”: 45,
“department”: “Finance”
}
]

To further analyze the data, let’s calculate the average age of employees. We can achieve this using an aggregated query:

$average(employees.(age))

This query calculates the average age based on the age property of each employee and returns the result: 35.

These illustrations show the potential of JSONata queries for collecting and altering data. You can easily work with and gain insights from complex JSON structures thanks to JSONata’s flexibility and expressiveness.

If you’re eager to investigate other JSONata queries and find new ways to maximize the value of your data, check out the JSONata documentation, which provides comprehensive examples, syntactic explanations, and helpful hints to help you grasp the art of JSON data transformation.

You can also use the JSONata exerciser, an interactive program that offers practical training. It’s a terrific way to improve your knowledge of JSONata as well as your data transformation skills.

Simplify Data Manipulation with the JSONata Plugin

The JSONata Plugin is a powerful tool that brings the abilities of JSONata, a versatile query and transformation language for JSON data, to your Workload Automation environment. This plugin extends beyond JSON data and supports querying and conversion of XML and YAML data as well.

The JSONata Plugin makes it simple to carry out intricate data manipulations and extract the data you require from your documents. A result is automatically saved as an output property for the task for each query that is run using the plugin. This enables seamless data flow and task integration by allowing the outcome of one query to be used as the input for future jobs in a jobstream.

The JSONata Plugin is notable for its handling of XML and YAML documents. When XML or YAML data is encountered, the plugin automatically converts it to JSON format, enabling you to use JSONata queries with no further effort. This flexibility now lets you use JSONata to greatest advantage across a variety of data formats, eliminating the need for manual conversion.

In addition, the JSONata Plugin makes it easy to pass variables, enabling you to supply the input document from a previous job, such as a RESTful service. As a result, it’s simple to chain jobs together, passing the results of one job as the input for queries in other processes that use JSONata. This dynamic workflow connection makes it easy to construct complex data processing pipelines.

The JSONata Plugin is quick and effective whether you’re carrying out straightforward data filtering or intricate modifications. You can harness the power of JSONata and streamline your data manipulation chores with Workload Automation, providing quicker and more precise data processing throughout your automation workflows.

The JSONata Plugin can be found in the category of the WorkLoad Designer catalogue devoted to tools for data manipulation and transformation. See the image below to learn where you can get the JSONata Plugin for easy integration into your automation workflows.

Figure 1: Job definition page

Action

In the Action tab, you must specify:

  • The document formats.
  • The input document, whose format should match the one provided above.
  • One or more queries to be performed on the document, where the name of each one has to correspond to the name of an output property containing the result of the query.

A screenshot of a computer Description automatically generated with medium confidence

Figure 2: Action page

Submitting Your Job

You can now submit the job according to the current plan. After selecting the Submit icon, click Ok. You can move to the Monitoring and Reporting tab to check what’s happening when a confirmation message appears.

A screenshot of a computer Description automatically generated with medium confidence

Figure 3: Submitting job

Monitor Page.

You can visit the monitor page to see the status of the work after you’ve submitted it:

A screenshot of a computer Description automatically generated with medium confidence

Figure 4: Monitor page

Job Log

You can view the job log from the monitor page:

 

Figure 5: Job Log

Output Properties

You can view the output properties of the job from the monitor page:

A screenshot of a computer Description automatically generated with medium confidence

Figure 6: Output properties

Conclusion

The JSONata Plugin for Workload Automation provides robust JSON, XML, and YAML data manipulation capabilities. Your automation workflows can easily extract, manipulate, and filter data by incorporating JSONata queries into them. Variable passing is supported by the plugin, enabling dynamic input from diverse sources. Optimize your data processing operations using Workload Automation’s efficiency and versatility with JSONata.

Comment wrap
Automation | May 20, 2024
HCL Workload Automation 10.2.2: Enhanced Security, Flexibility, and Efficiency
HCL Workload Automation 10.2.2 streamlines your processes with simplified installation, enhanced security via rootless installs and CyberArk integration, plus observability with OpenTelemetry.
Automation | February 6, 2024
Send Email Plug-in: Deliver Emails Simply and Effectively
Automate email delivery with Send email plug-in for Workload Automation. Simplify communication workflows, improve efficiency, and download now!