XML Helper
The XML Helper converts XML to dictionaries or vice versa. It connects XML based APIs to the integration platform.
XML helper

Convert dictionary to XML

To convert a dictionary to XML, e.g. for use in the REST helper, use the Convert dictionary to XML action. Just reference the object directly, without {{}}
XML Helper Convert dictionary to XML

Convert XML to dictionary

To retrieve and XML file or endpoint, just include the internal Locoia reference or the external URL, like in the below screenshot the VAT-ID check of the EU commission. If your endpoint requires authentication, please create this first and then select it under Connector Auth.
Note: Since XML responses are sometimes "not so clean", please reference data as per the below. This is the better approach compared to JSONPath-notation.
If a XML only contains one entry of an object it will be outputes as a dictionary in JSON. However, if it has multiple entries of an object it will be outputed as a list of dictionaries. To check the output type dynamically in a flow you you use the Jinja mapping test, e.g.:
{% if dic1 is mapping %}"Dict"{% else %}"List"{% endif %}

Drop Namespaces

Sometimes you may want to drop the namespaces of an existing XML. This can be done with the Drop Namespaces action.
Last modified 26d ago