跳转到内容
Agentic Workflowdocs
v0.9.0免费安装

节点 / 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.

工作流 · first-workflow.awf 3 个步骤

My first workflow:包含 3 个步骤的工作流,从 When Started 开始,到 Edit Fields 结束。

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.

  • 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.email builds { "customer": { "email": … } }, and items[0].name builds 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.

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.

  • Shape the data for the next step: keep only title and url, and add a fixed source field.
  • Combine values, for example a fullName field 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.
设置项类型作用
Fields (必填)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.

  • 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 }}.

None. This node needs no connection and has no slots for other nodes.

  1. Get Page Metadata reads the current page.
  2. Edit Fields defines title (String, {{ $input.title }}), savedFrom (String, AWFlow) and priority (Number, 2).
  3. Data Store saves the tidy item.
  • 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"].
Fill and submit a web form from saved values 中级 · 8 分钟 无需设置
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Edit Fields”