Object

Get Object Keys

Returns an array of object keys.

Expression:

OBJ_KEYS(value: map)

Return:

array

Example of usage:

OBJ_KEYS({key1: "apple", key2: "pear", key3: "tomatoes"})

Return value:
["key1","key2","key3"]

Set Object Key

Returns a map with a modified key value without changing a previous object.

Expression:

OBJ_SET_KEY(object: map, key: string, value: any)

Return:

newObject: map

Example of usage:

OBJ_SET_KEY({key1: "apple", key2: "pear", key3: "tomatoes"}, "key1", "jack fruit")

Return value:
{"key1":"jack fruit","key2":"pear","key3":"tomatoes"}

Delete Object Key

Returns a map with a deleted key value without changing a previous object.

Expression:

OBJ_DELETE_KEY(object: map, key: string)

Return:

newObject: map

Example of usage:

OBJ_DELETE_KEY({key1: "apple", key2: "pear", key3: "tomatoes"}, "key3")

Return value:
{"key1":"apple","key2":"pear"}

Props to Array

Returns a converted map to props to array without changing a previous object.

Expression:

PROPS_TO_ARRAY(value: map)

Return:

propsToArray: map

Example of usage:

PROPS_TO_ARRAY({key1: "apple", key2: "pear", key3: "tomatoes"})

Return value:
[
    {"key":"key1","value":"apple"},
    {"key":"key2","value":"pear"},
    {"key":"key3","value":"tomatoes"}
]

Object from an Array

Returns a created object from an array.

key, value are mandatory in an expression

Expression:

OBJ_FROM_ARRAY(value: array { key: string, value: string })

Return:

convertedObject: map

Example of usage:

OBJ_FROM_ARRAY([{ key: "myKey", value: "myValue" }])

Return value:
{"myKey":"myValue"}

Last updated