JSONTOXML

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

Syntax

CS.SPARK_JSONTOXML(cellAddressOrValue)

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

Example

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

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

Paste the custom function below and paste it into A2:

=CS.SPARK_JSONTOXML(A1)

You should get the following result:

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

Sample file

Last updated