knoten / builtin / datatransformation
Pick Field
Pick a specific field from the input data
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Keep one field from the incoming data and drop everything else.
What it does
Section titled “What it does”Pick Field follows a dot path such as user.name into the incoming data and outputs only the value it finds there. What comes out depends on that value:
- An object is passed on as it is, so its fields become the new item.
- A list becomes one item per entry. Entries that are objects are passed on as they are; plain values (text, numbers) are wrapped as
{ "<name>": value }. - A single plain value is wrapped the same way, as
{ "<name>": value }.
The <name> is Output field name if you set it, otherwise the last part of the path (name for user.name).
When to use it
Section titled “When to use it”- Pull the useful list out of an API response, for example
data.results, so the next nodes work on the results directly. - Reduce a big object to the one value you need before a message or a comparison.
- Turn a list of plain values (such as
tags) into separate items you can loop over. - To change or remove several fields at once, use Edit Fields instead. To split a list while keeping the other fields, use Split Out.
Inputs and settings
Section titled “Inputs and settings”| Einstellung | Typ | Was es bewirkt |
|---|---|---|
| FieldPath (erforderlich) | Text | The path to the field to pick from the input object (without the node's name or id). |
| Output field name | Text | The name of the output field to be used in case the target data is an array of non objects (like strings, numbers, etc.). |
Write FieldPath as plain field names joined by dots, starting from the incoming data: user.name, not $input.user.name or the node’s name. If the incoming data is a list, start with the position of the item, counting from 0: 0.title reads the title of the first item.
Outputs
Section titled “Outputs”-
Output
For example, with the input { "user": { "name": "Ada", "tags": ["vip", "beta"] } }:
useroutputs{ "name": "Ada", "tags": ["vip", "beta"] }.user.nameoutputs{ "name": "Ada" }.user.tagswith Output field nametagoutputs two items:{ "tag": "vip" }and{ "tag": "beta" }.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- An Http Request node calls an API that answers
{ "data": { "results": [ ... ] } }. - Pick Field with FieldPath
data.resultsoutputs one item per result. - Limit with Max Items
5keeps the first five. - A Slack node posts each result’s
titlewith{{ $input.title }}.
Common issues
Section titled “Common issues”- “Field “…” does not exist in the input object”. One part of the path is missing or misspelled. The message shows the data the node received: compare the names, including upper and lower case. If the data is a list, start the path with an item position such as
0.. - “No source node is connected to this node.” Pick Field has nothing to read. Connect the node that produces the data to its input.
- The output field has an unexpected name. Plain values are named after the last part of the path. Set Output field name to choose the name.
Related nodes
Section titled “Related nodes”- Edit Fields: add, change or remove several fields.
- Split Out: turn a list field into separate items.
- Rename Keys: change field names without dropping data.