JSON TransformObject
fromEntries
Convert an array of [key, value] pairs back into an object
fromEntries
Inverse of entries. Builds an object from an array of two-element arrays where the first element is the key (string) and the second is the value.
Options
This operation takes no options; pass an empty object or omit options entirely.
Example
Input
[
["id", 1],
["name", "Ada"]
]Operation
{ "type": "fromEntries" }Output
{ "id": 1, "name": "Ada" }In a Circuit Step
{
"name": "rebuild_object",
"description": "Reassemble [key, value] pairs into an object",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ user_entries }}",
"operations": [
{ "type": "fromEntries" }
]
},
"outputs": [
{
"name": "rebuilt_user",
"description": "Object reconstructed from key-value pairs",
"value": "${{ rebuild_object.output.transformed_result }}"
}
]
}Notes & gotchas
- Errors with
fromEntries: expected arrayif the input is not an array. - Each entry must be an array with at least two elements and the first must be a string. Entries violating either rule are silently skipped.
- Duplicate keys are resolved by "last write wins" — later entries overwrite earlier ones.
- Useful for the
entries → map → fromEntriespattern: rename / rewrite values en masse.