What it is for
The XML component lets you convert data between JSON and XML in flooows. It is useful when working with systems that only accept or return XML, such as some ERPs, e-invoicing services or SOAP APIs.
The XML component has no triggers: use it as an action inside flows started by other triggers.
Set up the connection
- 1No connection is needed: it is a built-in flooows utility.
- 2Add a step with "+" and search for XML.
- 3Choose Convert JSON to XML, Convert XML to JSON or Create XML.
- 4Map the input data and test the step.
Credentials are stored encrypted in your isolated database, in Spain, and are never shown in plain text.
How to use it in a flow
- Convert XML to JSON: map an API response or file content into "XML"; enable "Keep Leading Zeros" to preserve codes like 00123 and "Ignore Attributes" if you do not need attributes.
- Convert JSON to XML: pass the object in "JSON" and optionally set the "Attribute field" and "Header".
- Create XML: gives more control with "Root Element", "List Item Element", "Pretty Print", "Include XML Declaration" and keys for attributes, text or CDATA.
- Use the result in an HTTP step or save it as a file.
Tips
- •Shape the object first with Data Mapper so the XML matches the required structure exactly.
- •Enable "Include XML Declaration" if the target system requires it.
- •After converting XML to JSON, test the step to see how lists and attributes look before mapping them.
Actions (3)
Operations available as flow steps. Expand each one to see its fields.
Convert JSON to XML3 fields
| Field | Type | Required |
|---|---|---|
| JSON | JSON | Yes |
| Attribute field | Text | No |
| Header | Yes / No | No |
Convert XML to JSON3 fields
| Field | Type | Required |
|---|---|---|
| XML | Long text | Yes |
| Ignore Attributes | Yes / No | No |
| Keep Leading Zeros | Yes / No | No |
Create XML9 fields
| Field | Type | Required |
|---|---|---|
| JSON | JSON | Yes |
| Root Element | Text | No |
| List Item Element | Text | No |
| Pretty Print | Yes / No | No |
| Include XML Declaration | Yes / No | No |
| Self-Close Empty Elements | Yes / No | No |
| Attribute Prefix | Text | No |
| Text Key | Text | No |
| CDATA Key | Text | No |
Common errors
XML parse error
The input is not valid XML; make sure you map the response body, not the whole response.
Leading zeros are lost
Enable "Keep Leading Zeros".
Unwanted element names
Set "Root Element" and "List Item Element" in Create XML.
Field types
"List (from your account)" loads options from your connected account; "Dynamic fields" appear depending on earlier choices; in any field you can insert data from previous steps with the data selector (e.g. {{trigger.email}}). More about data between steps
