Exporting Contentserv to CSV
Exporting Contentserv to CSV
Module Overview
This module serves as the starting point for the export process. After exporting data to a CSV file, the output can be further processed via a “connect step”, for example:
- Converted into another file format
- Imported into a database
- Used as a web service call
Step Configuration
Step Positions
As is standard in ADIB, the fields to be exported are defined under the Step Positions section.
At this point, the Contentserv attribute to be exported is selected.
In the field srcField, the name of the Contentserv field appears along with its internal attribute ID.
Before configuring the export, ensure that:
- The Contentserv data model has been created via ADIB, or
- The Contentserv attributes have been imported using the functions available in ADIB.
In addition to main attributes, you can also select attributes from Subtables. These subtable attributes are displayed with a red background.
Step Parameters
Step parameters define how the export is executed. The following configurations are available:
1. Export to a Single File
All selected fields are exported into a single CSV file. This configuration also supports the export of references and even complete subtables. For subtables, you can choose the export format:
- JSON structure, or
- HTML table
Note: In both cases, the subtable content (e.g., an HTML table) is exported as a single column within the CSV file.
2. Export to Two Files
In this configuration, the data is split into two separate CSV files:
- The main attributes (directly linked to the Contentserv object) are exported to the first CSV file.
- The subtable attributes are exported to a second CSV file, called the “subtable CSV.”
This approach ensures that complete HTML or JSON tables are not embedded within a single cell. All selected subtable fields are included in the subtable CSV — even if the export contains multiple subtables with different column structures. In such cases, unrelated columns in each row remain empty.
Export Configuration via export_mapping_fields
The export behavior is controlled using the JSON parameter export_mapping_fields.
The following options can be defined:
| Parameter | Type | Description |
|---|---|---|
"Subtable" |
Boolean | Exports subtable fields if set to true. |
"Reference" |
Boolean | Exports references if set to true. |
"Create_TABLE" |
Boolean | Defines whether a table should be created for subtable/reference fields. (TODO: Verify behavior.) |
"Create_SUBTABLE" |
Boolean | Defines whether a separate table for subtables should be created. |
"Create_JSON" |
Boolean | Exports subtables/references as a JSON structure within a single CSV cell. |
"Create_REFERENCE" |
Boolean | Creates references as a separate table if set to true. |
"Create_VALUE" |
Boolean | Outputs the values of subtables/references. |
"Create_FILE4SUBTABLE" |
Boolean | Writes subtable fields to a separate CSV file if set to true. |
Note: When
"Create_FILE4SUBTABLE"is enabled, the subtable file name includes the suffix_subtable.csv.
The key parameter in this configuration is "Create_FILE4SUBTABLE", as it determines whether subtable data is exported separately.