Skip to content

How do I create a JSON Object from the contents of a dataset

This example demonstrates creating a JSON Object from the contents of a dataset(temporary data table generated during the execution). 

In the solution shown below, a JSON object is created from the dataset by converting the attributes of the dataset into "Keys" and the contents of the dataset into "Values" using "jsonCreateObjectFromDataSet" command. The JSON object is stored into a variable.

Note: The notation to reuse the value of the variable in Worksoft SaaS is ${<Variable Name>}.

Solution:

# Command Target Value
Creating a JSON object from a dataset
1 jsonCreateObjectFromDataSet Insurance_Details_Dataset Insurance_Details_JSON

Tips, Tricks, Gotchas & Best Practices:  

  • As a best practice, it is always advisable to define the variable names without any spaces and if you want to differentiate the words, use underscores.
  • It is mandatory to create the dataset(temporary data table) with the content that needs to converted into JSON object before executing the "jsonCreateObjectFromDataSet" command.


Feedback and Knowledge Base