JSON TransformObject
entries
Convert an object into an array of [key, value] pairs
entries
Returns an array of two-element arrays, each containing a key and its value.
Options
This operation takes no options; pass an empty object or omit options entirely.
Example
Input
{ "id": 1, "name": "Ada" }Operation
{ "type": "entries" }Output
[
["id", 1],
["name", "Ada"]
]In a Circuit Step
{
"name": "to_pairs",
"description": "Convert the user object to a list of [key, value] pairs",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ user }}",
"operations": [
{ "type": "entries" }
]
},
"outputs": [
{
"name": "user_entries",
"description": "Array of [key, value] pairs",
"value": "${{ to_pairs.output.transformed_result }}"
}
]
}Notes & gotchas
- Errors with
entries: expected objectif the input is not an object. - Output order matches the input key order.
- Pairs nicely with
mapfor per-entry transformations and withfromEntriesto round-trip back to an object.