XML: Convert XML to JSON

🕙  1 minute read

Use this action to transform XML formatted text into JSON formatted text.

To save a single value from an XML string, try using the XML: Parse string field action—this action is best for simple strings where only one item is needed.

Use case

This action is typically part of a process that involves Web API actions. A common application for this action is to convert the output of the Web API: Send Get Request action to JSON to use in a field formula or converted into a Catalytic field with the Field: Create fields from JSON action.

How to configure this action

Here’s a example of XML text as an input for this action:

<?xml version="1.0" encoding="UTF-8" ?><account><accountID>12345</accountID><accountName>Vandelay Industries</accountName><employees><employeeID>1</employeeID><name>Art Vandelay</name></employees><employees><employeeID>2</employeeID><name>Kel Varnsen</name></employees></account>

Here is the above XML converted into valid JSON using this action:

{
    "account": {
        "accountID": "12345",
        "accountName": "Vandelay Industries",
        "employees": [
            {
                "employeeID": "1",
                "name": "Art Vandelay"
            },
            {
                "employeeID": "2",
                "name": "Kel Varnsen"
            }
        ]
    }
}

Fields for this action

  • XML

    • Enter the XML text or field reference to XML text to convert into JSON format.
  • Output field name

    • Enter the name of the field to store the converted XML text.

What will this output?

Output fields for this action

  • Output field name

    • This field stores the converted text in JSON format. The field name will be the output field name defined during configuration.

Sorry about that. What was the most unhelpful part?









Thanks for your feedback

We update the Help Center daily, so expect changes soon.

Link Copied

Paste this URL anywhere to link straight to the section.

Need more help?

If you're signed in to Catalytic Community, you can ask other users a question. You'll be redirected to Community where you can add more info.