DATA FORMAT XML to JSON function

The DATA FORMAT XML to JSON function in RPA.

Help CentreFunctions & Formulas

This article describes the RPA Data Format functionality to convert XML to JSON.

For a full list of available functions, please read DATA FORMAT functions.


Description

The XML to JSON function converts an XML string into a JSON object. XML attributes are converted to keys prefixed with @.


Setting it up

To use the XML to JSON function, follow these instructions:

{{popups:rpas/add:action=xml-to-json}}

Once on a process map:

  1. Navigate to the process where you would like to add the XML to JSON function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the DATA FORMAT XML to JSON option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
DataYesText-The XML string to convert
VariableNoTextjsonVariable name to store the JSON output

Output variables

VariableTypeDescription
{json}ObjectThe JSON representation of the XML data

Errors

ErrorDescription
Invalid XMLThe data is not valid XML

Tips

  • XML attributes become @attr keys in the JSON output
  • Use json-query after conversion to navigate the resulting JSON

Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.