> For the complete documentation index, see [llms.txt](https://docs.cloudfabrix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudfabrix.io/rda/rda-userguide/rda-aiops-studio/examples-jupyter/data-mapping-cfxdm-dm-functions/jsondecode.md).

# jsonDecode

\
Decodes input string into a JSON object. Requires no parameters. Input must be a string.

This function allows users to convert data columns with string input proper JSON object. This function helps datasets with string formats to be converted to JSON objects for further processing.&#x20;

### Example 1:&#x20;

Step 1: Create an empty **jsondecode\_example\_1** using AIOps studio as shown in the below screenshot.

![Empty pipeline jsondecode\_example\_1 created via RDA](/files/-MeHHQb4fkiE4HNfcpvP)

Step 2: Add the following pipeline code/commands into the above-created pipeline as shown in the below screenshot:

You can copy the below code into your pipeline and execute that in your environment.\
\
\&#xNAN;*`##### This pipeline creates a simple records using AIOps studio.`*\
\
*`##### RDA function jsonDecode is used to demo this example.`*\
*`##### This function uses string input of multiple rows and converts into JSON`* \
*`##### Object`*\
\
*`@dm:empty`* \
*`--> @dm:addrow attributes = '{"a":1, "b":2, "c": { "d":3, "e":4} }'`*  \
*`--> @dm:addrow attributes = '{"p":11, "b":12, "c": { "d":13, "e":14} }'`* \
*`--> @dm:addrow attributes = '{"cfx":4301}'`*\
*`--> @dm:addrow attributes = '{"rda":999}'`*\
*`--> @dm:map from = 'attributes' & to = "json_attributes" & func = "jsonDecode"`* <br>

![Pipeline code added to the empty pipeline created  ](/files/-MeHLecpQGylEkEMHdyU)

Step 3: Click verify button to make sure syntax and pipeline code is correct (as shown below)

![Pipeline code is verified using 'Verify' button for any errors as shown above.](/files/-MeHMBlaPzlAWjmQCjuv)

Step 4:  Click execute button and execute the pipeline. RDA will execute the pipeline without any errors (as shown below)

![Execution of pipeline without any errors as shown above.](/files/-MeHMf0A_8vMi0M7tURW)

Step 5: RDA uses the dm function 'jsonDecode' to convert string attributes as shown above into JSON objects and saves under the column "json\_attributes' and prints the output for each dataset (or row) as shown in the following screenshot.

![String objects are converted to JSON objects and are stored under json\_attributes as shown above.](/files/-MeHNiz8uOGpl25iDwIc)

**Note: The above example uses string objects that contain numeric values.**&#x20;

### Example 2:&#x20;

Step 1: Create an empty **jsondecode\_example\_2** using AIOps studio as shown in the below screenshot.

![Empty pipeline jsondecode\_example\_2 created via RDA](/files/-MeHOXnW2sb0O2u4smDT)

Step 2: Add the following pipeline code/commands into the above-created pipeline as shown in the below screenshot:

You can copy the below code into your pipeline and execute that in your environment.\
\
\&#xNAN;*`##### This pipeline creates a simple records using AIOps studio.`*\
\
*`##### RDA function jsonDecode is used to demo this example.`*\
*`##### This function uses string input of multiple rows and converts into JSON`* \
*`##### Object`*\
\
*`@dm:empty`* \
*`--> @dm:addrow attributes = '{"a":"r", "b":"d", "c":"a"}'`*\
*`--> @dm:addrow attributes = '{"cfx":"tool", "rda":"data", "use":"transformation"}'`*\
*`--> @dm:map from = 'attributes' & to = "json_attributes" & func = "jsonDecode"`* <br>

![Pipeline code added ](/files/-MeHUPLbIuF_3_cnfHiB)

Step 3: Click verify button to make sure syntax and pipeline code is correct (as shown below)

![Pipeline code is verified using 'Verify' button for any errors as shown above.](/files/-MeHUyxw6bsx3zLUyEo8)

Step 4:  Click execute button and execute the pipeline. RDA will execute the pipeline without any errors (as shown below)

![Execution of pipeline without any errors as shown above.](/files/-MeHVRZlNOi9CJf_A72y)

Step 5: RDA uses the dm function 'jsonDecode' to convert string attributes as shown above into JSON objects and saves under the column "json\_attributes' and prints the output for each dataset (or row) as shown in the following screenshot.

![String objects are converted to JSON objects and are stored under json\_attributes as shown above.](/files/-MeHVyJlDm9qYdYFyGWi)

**Note: The above example uses string objects that contain string values.**&#x20;

###
