JSON TransformObject
pick
Keep only the specified keys of an object
pick
Returns a new object containing only the keys listed in keys (when present in the input). Order in the output follows the order of keys.
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
keys | array<string> | Yes | — | Top-level keys to retain. |
Example
Input
{ "id": 1, "name": "Ada", "email": "ada@example.com", "secret": "shh" }Operation
{ "type": "pick", "options": { "keys": ["id", "name"] } }Output
{ "id": 1, "name": "Ada" }In a Circuit Step
{
"name": "project_user_summary",
"description": "Keep only the public-safe user fields",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ user }}",
"operations": [
{ "type": "pick", "options": { "keys": ["id", "name"] } }
]
},
"outputs": [
{
"name": "user_summary",
"description": "User object reduced to id and name",
"value": "${{ project_user_summary.output.transformed_result }}"
}
]
}