nodes / builtin / datatransformation
Edit Fields
Modify, add or remove item fields
Add, set or reshape fields: each with a name, a type and a value. Keep the other fields of the item, or only the ones you list.
Try it
Section titled “Try it”My first workflow: a workflow with 3 steps, starting with When Started and ending with Edit Fields.
What it does
Section titled “What it does”Edit Fields sets the fields you define in Fields. 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. The step runs once per incoming item, so ten items in give ten edited items out.
Version 2 (new steps in AWFlow 0.9)
Section titled “Version 2 (new steps in AWFlow 0.9)”- Keep other input fields: None (only your fields), All (every input field, plus yours), Only these… or All except… (pick in Fields to keep).
- Dots make nested fields: a name like
customer.emailbuilds{ "customer": { "email": … } }, anditems[0].namebuilds a list. - Mode › JSON: write the whole item as JSON with
{{ }}holes. Values are inserted correctly (escaped inside a string, real numbers and lists outside), so the JSON stays valid. - If a value doesn’t fit its type: Stop the step (naming the field and the item), Keep the text (with a warning in the run log), or As older steps (text in a number field becomes 0).
- A new Edit Fields step opens with one blank row, its name ready to type. It is saved only once you give it a name or a value.
- Add all fields from previous step adds one row per incoming field; tapping a value in the Input pane adds a row for it.
Steps saved before AWFlow 0.9
Section titled “Steps saved before AWFlow 0.9”They output only the fields you list: incoming fields are not kept. To keep one, add it with an expression such as {{ $input.title }}. Update in the step’s header moves to version 2 while keeping literal names (a dot stays a dot) and the old conversions.
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”| Setting | Type | What it does |
|---|---|---|
| Fields (required) | Key-value pairs |
How each type treats the value (with As older steps, and in steps saved before 0.9):
| Type | Accepts | Otherwise |
|---|---|---|
| Number | a number, or text that is one ("42") |
0, with a warning in the run log |
| Boolean | true/false, and yes/no, on/off, 1/0 in any case; empty text is false |
other text is true, with a warning |
| Array | a JSON list such as ["a", "b"], or text with commas (a, b), which is what a mapped list turns into |
an empty list |
| Object | a JSON object such as {"plan": "pro"} (line breaks and accents are kept) |
the step stops with an error |
| Date-Time | a date and time | — |
| String | anything, after expressions are filled in | — |
A field holding only {{ … }} keeps the mapped value: a mapped number stays a number in a Number field, a mapped false stays false.
Outputs
Section titled “Outputs”-
Output
Each output item holds the fields you defined (plus the input fields you chose to keep), 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 step is missing. Set Keep other input fields to All (version 2), or add the field with an expression such as
{{ $input.url }}. - “Name already used”. Two rows have the same name; only the first is kept until you rename one.
- “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.