FlattenArrays Parameter (Connect-JSON Cmdlet)
Specifies how many elements of nested JSON arrays are flattened into individual columns.
Syntax
Connect-JSON -FlattenArrays string
Data Type
cstr
Default Value
""
Remarks
When this property is not set, nested arrays are returned as JSON strings. When this property is set to a positive integer, that number of elements from each nested array is flattened into separate columns. The element index is appended to each column name.
When this property is set to -1, all elements in nested arrays are flattened into individual columns.
The following example shows how a nested array is flattened:
["FLOW-MATIC","LISP","COBOL"]When FlattenArrays is set to 1, the array above is flattened into the following table:
| Column Name | Column Value |
| languages.0 | FLOW-MATIC |
Flattening is only recommended for arrays that are expected to be short, as flattening large arrays can significantly increase the number of columns and reduce performance.
This property is useful for controlling how nested arrays are represented in flattened JSON data models.