JSON TransformObject
keys
Return an object's keys as an array
keys
Returns an array containing the keys of the current object, in insertion order.
Options
This operation takes no options; pass an empty object or omit options entirely.
Example
Input
{ "id": 1, "name": "Ada", "active": true }Operation
{ "type": "keys" }Output
["id", "name", "active"]In a Circuit Step
{
"name": "list_field_names",
"description": "List the top-level field names of the user object",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ user }}",
"operations": [
{ "type": "keys" }
]
},
"outputs": [
{
"name": "user_field_names",
"description": "Array of field names on the user object",
"value": "${{ list_field_names.output.transformed_result }}"
}
]
}Notes & gotchas
- Errors with
keys: expected objectif the input is not an object. - Output order matches the underlying
serde_json::Mapinsertion order, which preserves the JSON source order. - The output is an array, so subsequent operations should target arrays — common chains include
keys → sort,keys → filter.