XMLTOJSON

Converts an valid XML string into JSON and returns it as string.

Syntax

CS.SPARK_XMLTOJSON(cellAddressOrValue)

  • cellAddressOrValue Required. Either the address of the cell that contains XML or XML string.

Example

Copy the example XML data below and paste it into the cell A1 of a new worksheet.

<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
</note>

Paste the custom function below and paste it into A2:

=CS.SPARK_XMLTOJSON(A1)

You should get the following result:

{
    "note": {
        "to": "Tove",
        "from": "Jani",
        "heading": "Reminder",
        "body": "Don't forget me this weekend!"
    }
}

Last updated