younifyd
Menu

XML to JSON

Convert XML to JSON

Use it in a workflow

  1. Add a step and choose the Data Converter connector.
  2. Pick the XML to JSON action (under helper).
  3. Fill in the fields below, then reference the result from later steps as {{xmlToJson.response.data}}.

Fields

contentstringrequired

The XML to convert, e.g. {{downloadFile.response.data.content}}.

inputEncodingstring

Choose base64 for content from the FTP, SFTP or File connectors.

One oftextbase64Default "text"

arrayPathsstring

Comma-separated element paths that are always lists, even when only one appears, e.g. Orders.Order.

attributePrefixstring

XML attributes appear as keys with this prefix, e.g. @_id.

Default "@_"

inferTypesboolean

Read "12" as 12 and "true" as true. Values with leading zeros or 16+ digits stay text.

Default true

returnAsstring

value: data you can reference field by field. text: JSON text. base64: for uploading with FTP, SFTP or File.

One ofvaluetextbase64Default "value"

prettyboolean

Indent the output.

Default true

Examples

XML to JSON

Convert XML to JSON

json
{
  "content": "<Orders><Order><id>1</id></Order></Orders>",
  "arrayPaths": "Orders.Order"
}

Need more? See the Data Converter guide for connection setup and behaviour shared by every action.

Was this page helpful?