Business Integration Solutions SaaS

About: XMLTOTEXTTRANSLATOR Activity

In Business Integration Solutions, use the XMLTOTEXTTRANSLATOR activity to convert an XML document to a TEXT document.

Usage

Use this activity to translate an XML document, containing data from Business Central, into a fixed length document.

Concept

A fixed width text file is a file that has a specific format which allows for the saving of textual information/data in an organized fashion. Fixed width text files are special cases of text files where the format is specified by column widths, pad character and left/right alignment. Column widths are in units of characters. So if you have data in a text file where the first column always has exactly 10 characters, and the second column has exactly 5, the third has exactly 12 (and so on), then you have a fixed width text file.

Each row (paragraph) contains one record of information; each record can contain multiple pieces of data (fields), each data field (column) has a precise number of characters. The data is padded with spaces (or any character you specify) if it does not completely use all the characters allotted to it. In addition, each piece of data can be left or right justified, meaning the padding of characters can occur on either side.

In case your company wants to publish data stored in Text format then you must use the XML to Text Translator activity in your export pipeline. This activity helps you to convert the outgoing data into fixed length format, based on a predefined internal/external document. To be able to use this activity, you must define an internal/external document, based on which the outgoing data will be translated. Also, you can choose to include headers from your table structure. For each node name you can define Width, Alignment and Filler Character.

XMLToTextTranslator

Limitations / Considerations

The XMLTOTEXTTRANSLATOR expects a root node with a list of repeated nodes. When using a splitter before running this translator, the repeated node before splitting will become the root node of the newly splitted documents. This means that this translator cannot export data of that record since it is now the root node.

The XMLTOTEXTTRANSLATOR expects only one block node in the document. As shown in the example above, Purchase Line cannot be used in the document used for this translator, as that would mean having multiple block nodes (represented in bold).


XML input ➡️ [XML to Text Translator] ➡️ [Text output]