Join this online 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.
Hello Everyone!
When working with new low-code/no-code automation users, a common topic of interest is how to work with the JSON objects that get returned from API endpoint queries. I'll be covering the basics in this blog.
When using a JSON object, it is typically given a variable name to represent the entire object (such as "cat" in our example).
Whew!!! Ok, now that we've explained the mechanics, lets look at how we might use this object in a low-code/no-code automation.
IBM has a low-code/no-code automation solution known as "Concert Workflows". It allows users to create their own workflows using a drag-and-drop visual interface where you drag and combine "action blocks" representing api endpoints, logic components, existing automation scripts (Python, Ansible), etc. into an orderly workflow, allowing them to automate and accomplish any number of tasks.
All workflows start with a "Start" block, where we can define "variables" which are holders for our data.
As a best practice, when creating your own workflows, it is recommended to use comments to describe what it is that you need to accomplish in your workflow. This is referred to as defining your workflow using "pseudocode". IBM's CW solution provides you with a comment block you can use for this purpose.
All start blocks contain an empty variable called "result". We can use this to return the final result to the user if we like.
We define an empty "cat" object that will be populated by the CatMD RESTful endpoint query.
If found, we will assign the $result variable defined in the Start Block the following variable:
Finally we see our $result in the Logs window:
Copy