All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

TransformationNodeBuilder.UnfoldColumn(String, String) Method

If a column is an array, transforms each element of this array to an individual record and changes the name of the column to the specified alias.

Namespace: DevExpress.DataAccess.DataFederation

Assembly: DevExpress.DataAccess.v21.1.dll

Declaration

public TransformationNodeBuilder UnfoldColumn(
    string columnName,
    string alias
)

Parameters

Name Type Description
columnName String

The name of a column that should be unfolded.

alias String

A new column name.

Returns

Type Description
TransformationNodeBuilder

The result of the transformation query.

Example

The following example demonstrates how to unfold a data source’s Products array and specify a new name for this array:

Show JSON Data
[
    {
        "CategoryID": 1,
        "Products":
        [
            {
                "ProductName": "Chai",
                "UnitPrice": 18
            },
            {
                "ProductName": "Chang",
                "UnitPrice": 19
            }
        ]
    },
    {
        "CategoryID": 2,
        "Products":
        [
            {
                "ProductName": "Ikura",
                "UnitPrice": 31
            },
            {
                "ProductName": "Konbu",
                "UnitPrice": 6
            }
        ]
    }
]
using DevExpress.DataAccess.DataFederation;
using DevExpress.DataAccess.Json;
// ...
var source = new Source("Products", jsonDataSource);

var query = source
    .Transform()
    .UnfoldColumn("Products", "CategoryProducts")
    .Build("ProductsUnfolded");

var federation = new FederationDataSource() {
    Queries = { query }
};

The following schema is the result of the transformation:

"CategoryID": int
"CategoryProducts"
    "ProductName": string
    "UnitPrice": int
See Also