Help Centre › Functions & Formulas
This article describes the RPA Data Format functionality to convert JSON to XML.
For a full list of available functions, please read DATA FORMAT functions.
Description
The JSON to XML function converts JSON data into an XML string. Nested JSON objects produce nested XML elements.
Setting it up
To use the JSON to XML function, follow these instructions:
{{popups:rpas/add:action=json-to-xml}}
Once on a process map:
- Navigate to the process where you would like to add the JSON to XML function
- Click on the green button’s drop-down (right side of the green button labelled “Process”)
- On the menu that appears, click on the “+ Activity” item
- From here you can select the DATA FORMAT JSON to XML option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Data | Yes | Text | - | The JSON data to convert |
| Root Tag | No | Text | root | The tag name for the root XML element |
| Variable | No | Text | xml | Variable name to store the XML output |
Output variables
| Variable | Type | Description |
|---|---|---|
| {xml} | String | The generated XML string |
Errors
| Error | Description |
|---|---|
| Invalid JSON | The data is not valid JSON |
Tips
- Nested JSON objects produce nested XML elements
- JSON arrays are converted to repeated elements