unpivot_array¶
Description¶
Convert an object into an array of “key”-“value” pairs.
Return type¶
array
Domain¶
This is a scalar function (calculates a single output value for a single input row.)
Categories¶
Usage¶
unpivot_array( object, keyFieldName, valueFieldName )
Argument |
Type |
Required |
Multiple |
Constant |
---|---|---|---|---|
object |
object |
Required |
Only one |
Variable |
keyFieldName |
string |
Required |
Only one |
Variable |
valueFieldName |
string |
Required |
Only one |
Variable |
Examples¶
unpivot_array(object(FIELD.foo), "key", "value")
Converts ‘{“k1”: “v1”, “k2”: “v2”, …}’ to ‘[{“key”: “k1”, “value”: “v1”}, {“key”: “k2”, “value”: “v2”}, …]’
Aliases¶
array_unpivot
(deprecated)