FlattenObjects
Specifies whether object properties are flattened into individual columns.
Data Type
bool
Default Value
true
Remarks
When FlattenObjects is set to true, the connector flattens object properties into separate columns. An element is considered an object if it appears only once at its level in the XML structure. If an element repeats at the same level, it is considered an array.
When this property is set to false, objects nested within arrays are returned as XML strings instead of flattened columns.
The following example shows how nested objects are flattened at connection time:
<grades> <grade>A</grade> <score>2</score> </grades> <grades> <grade>A</grade> <score>6</score> </grades> <grades> <grade>A</grade> <score>10</score> </grades> <grades> <grade>A</grade> <score>9</score> </grades> <grades> <grade>B</grade> <score>14</score> </grades>To generate the column name, the connector concatenates the property name onto the object name with a dot. When FlattenObjects is set to true and FlattenArrays is set to 1, the preceding array is flattened into the following table:
| Column Name | Column Value |
| grades.0.grade | A |
| grades.0.score | 2 |
Flattening objects simplifies querying nested data but can increase the number of columns when applied to deeply nested structures.
This property is useful for controlling how nested objects are represented in flattened XML data models.