Search

Home

Home

CONVERT BITS TO FORMAT

CONVERT BITS TO FORMAT

The CONVERT BITS TO FORMAT operator allows you to transform data from the input bus into a uniform text format that complies with the requirements of further processing or integration with external systems.

Data from the stream (records and bits) can be automatically converted into popular structured formats such as:

  • JSON – JavaScript Object Notation,
  • XML – Extensible Markup Language,
  • CSV – Comma-Separated Values.

Additionally, the operator offers a User format mode that provides full control over the output structure, allowing you to define your own text layout using tags and templates. This way, you can convert bus data into any format you need, for example:

  • HTML
  • EPP
  • EDI (e.g. EDIFACT, X12),
  • or other text structures specific to a given use case.

The operator performs the transformation for the entire data stream, which makes it possible to group data — in other words, to build nested structures.

Example project using the CONVERT BITS TO FORMAT operator:

image

The operator allows you to convert input bus data into any text-based data format, which can also have a hierarchical structure. The text generated according to the selected and configured format is added to the output bus as an additional data bit named file_data.

The operator’s output bus differs from the input bus, and the number of bits and records depends on how the input bus bits are used to build the text data format.

The output bus will contain only those bits that were used to build the first-level data in the text format, as well as the file_data bit, which stores the generated text. The number of records in the bus will result from grouping the input bus using the first-level bits.

This means that the operator can generate text-based data from a bus that carries parent–child relationships (the parent’s bit values are repeated as many times as there are child records, e.g., order → items). In the output bus, only the parent data bits will remain, along with the bit containing the text data, and the number of records will correspond to the number of parent records.

For example, if the bus carries data for three (3) orders and each order has two (2) items, there will be a total of six (6) records on the input bus. When creating a JSON text format, you use only the order bits at the first level and the item bits at the second. The output bus will then contain only three (3) records, the first-level bits, as well as the text bit file_data.

OPERATOR CONFIGURATION

The operator configuration involves selecting the format to which you want to convert the input bus bits and using the corresponding format editor to define the conversion.

You can choose from the following data formats:

image
  • XLSX file → Allows you to convert data into Excel format.
  • image
  • CSV file → Allows you to convert data into CSV format.
  • image
  • XML file → Allows you to convert data into XML format. After selecting this option, you will see the XML File format tab, where you need to click Define XML scheme. The XML Format EditorXML Format Editor window will open, allowing you to build the XML structure.
  • image
  • JSON file → Allows you to convert data into JSON format. After selecting this option, you will see the JSON File format tab, where you need to click Define JSON scheme. The JSON Format EditorJSON Format Editor window will open, allowing you to build the JSON structure.
  • image
  • User format → Allows you to convert data into any text format. After selecting this option, you will see the User file format tab. You must define the opening and closing separators for the bus bits inserted in the editor, and then go to the Bits-to-Text Conversion Editor – User formatBits-to-Text Conversion Editor – User format, where you can build any text format you need.

PROPERTIES TAB

When defining the Result target field, you can decide how the operator should generate the output data bus. You can choose between two options:

  • Create a busbar with the columns from the first grouping bit text → Generates a bus containing the column values found at the first grouping level, as well as the bit with the generated data format file_data. This means that the output bus will have as many rows as the number of records resulting from the first grouping, and the data in the file_data bit corresponds to the data built from that first grouping level.
  • icon

    Use this type when you want to build data in the file_data bit for a specific group of bits — for example, the data of a particular invoice stored in separate file_data bits.

  • Create a busbar without grouped columns → The output bus will be built exclusively from the file_data bit, and the data in this bit will represent the entire output bus.
  • icon

    Use this type when you want the file_data bit to contain data from the entire bus — for example, when the bus carries data for many invoices and you want the bit to include the data of all invoices in a defined text format.