knoten / builtin / datatransformation
Edit Fields
Modify, add or remove item fields
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Build a new item with exactly the fields you list, each with a name, a type and a value.
Try it
Section titled “Try it”My first workflow: ein Workflow mit 3 Schritten, beginnend mit When Started und endend mit Edit Fields.
What it does
Section titled “What it does”Edit Fields outputs an item made of the fields you define in Fields, and nothing else. Each field has a name, a type (String, Number, Boolean, Date-Time, Array or Object) and a value. Values can be fixed text or expressions that read the incoming data.
Fields from the incoming item are not kept automatically. To keep one, add it with an expression such as {{ $input.title }}. To remove a field, simply leave it out. To rename one, add it under its new name.
The node runs once per incoming item, so ten items in give ten edited items out.
When to use it
Section titled “When to use it”- Shape the data for the next step: keep only
titleandurl, and add a fixedsourcefield. - Combine values, for example a
fullNamefield set to{{ $input.first }} {{ $input.last }}. - Turn text into a real number, list or object so later nodes such as Math or Sort treat it correctly.
- To rename keys while keeping all other fields, use Rename Keys. To pull out a single field, use Pick Field.
Inputs and settings
Section titled “Inputs and settings”| Einstellung | Typ | Was es bewirkt |
|---|---|---|
| Fields (erforderlich) | Key-value pairs |
How each type treats the value:
- Number: text that is not a number becomes
0. - Array: type a JSON list such as
["a", "b"]. Text that is not a valid list becomes an empty list. - Object: type a JSON object such as
{"plan": "pro"}. Invalid JSON stops the run with an error. - Date-Time: pick a date and time; it is passed on as a date.
- String: the value is passed on as typed, after expressions are filled in.
Outputs
Section titled “Outputs”-
Output
Each output item holds only the fields you defined, with the types you chose. Read them downstream with {{ $input.fieldName }}.
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”- Get Page Metadata reads the current page.
- Edit Fields defines
title(String,{{ $input.title }}),savedFrom(String,AWFlow) andpriority(Number,2). - Data Store saves the tidy item.
Common issues
Section titled “Common issues”- A field from the previous node is missing. Edit Fields only outputs what you list. Add the field with an expression such as
{{ $input.url }}. - “Failed to parse object …” A field of type Object does not contain valid JSON. Check quotes and braces, or change the type to String.
- A number field shows
0. The value was not a number, often because an expression returned text with a currency sign or a comma. Clean it first, for example with Regex. - An array field is empty. The value was not a valid JSON list. Use double quotes inside it:
["a", "b"].
Recipes with this node
Section titled “Recipes with this node”Related nodes
Section titled “Related nodes”- Rename Keys: rename fields and keep the rest.
- Pick Field: take out one field.
- Text / Formatter: change the text inside a field.
- Code: for reshaping that needs logic.