Page tree

Release 9.2


Contents:

   

You can extract the keys from an Object column into an Array of String values.

Functions:

ItemDescription
KEYS Function Extracts the key values from an Object data type column and stores them in an array of String values.

Source:

The following dataset contains configuration blocks for individual features, each of which has a different configuration. These example blocks are of Object type.

Tip: In the following example configuration, the keys are the values on the left (e.g. enabled, maxRows, and maxCols), while the values for those keys are on the right side.

Code formatting has been applied to the Object data to improve legibility.

FeatureNameConfiguration
Whiz Widget
{
 "enabled": "true",
 "maxRows": "1000",
 "maxCols": "100"
}
Magic Button
{
 "enabled": "false",
 "startDirectory": "/home",
 "maxDepth": "15"
}
Happy Path Finder
{
 "enabled": "true"
}

Transformation:

The following transformation extracts the keys from the Object data in the Configuration column.

Transformation Name New formula
Parameter: Formula type Single row formula
Parameter: Formula keys(Configuration)
Parameter: New column name 'keys_Configuration'

Results:

The keys_Configuration column contains the arrays of the key values.

FeatureNameConfigurationkeys_Configuration
Whiz Widget
{
 "enabled": "true",
 "maxRows": "1000",
 "maxCols": "100"
}
["enabled","maxRows","maxCols"]
Magic Button
{
 "enabled": "false",
 "startDirectory": "/home",
 "maxDepth": "15"
}
["enabled","startDirectory","maxDepth"]
Happy Path Finder
{
 "enabled": "true"
}
["enabled"]

See Also for EXAMPLE - Extract Keys From Objects:

This page has no comments.