0Pricing
No-Code Automation · 课时

使用聚合器与数组

学习如何使用聚合器和数组将多个项目合并为单个数据包,让工作流能够高效地汇总、分组和处理数据集合。

使用聚合器与数组 是 CoddyKit 上的免费 No-Code Automation 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 No-Code Automation 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 No-Code Automation 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

From Many Items to One

Workflows often produce many items at once — several rows from a sheet, multiple emails, a list of orders. Sometimes you need to combine them into a single result, such as one summary email instead of dozens.

This is the job of an aggregator.

What Is an Array?

An array is simply an ordered list of values. In automation, a step that returns multiple items effectively hands you an array — for example a list of customer names.

Understanding arrays is key to controlling how collections flow through your workflow.

Aggregators Explained

An aggregator takes the many items coming from an earlier step and merges them into one bundle. Instead of the workflow continuing once per item, it continues a single time with everything combined.

It is the opposite of an iterator, which splits one bundle into many items.

Text Aggregation

A common use is combining text. A text aggregator joins many values into one string, often separated by commas or new lines.

For example, ten task names become a single bulleted list you can drop into one notification.

Numeric Aggregation

Aggregators can also do math across items. A numeric aggregator can sum, average, count, or find the maximum of a field.

This lets a workflow calculate, say, total revenue from a list of orders in one step.

Grouping with Aggregators

Many aggregators support a group by setting. Instead of one big bundle, items are grouped by a shared key — like grouping orders by customer or sales by region.

Grouping turns a flat list into meaningful, organized chunks.

Array Aggregator

An array aggregator bundles multiple items back into a single structured array, preserving each item's fields.

This is useful when a later step expects a list — for example sending many line items to one invoice.

Pairing Iterators and Aggregators

A powerful pattern is iterate, then aggregate. You split a bundle into items with an iterator, process each one, then merge the results back with an aggregator.

This split-process-rejoin flow handles collections cleanly without manual steps.

Choosing the Right Source

When configuring an aggregator, you must pick the source module — the step whose output is being combined. Everything between that source and the aggregator is rolled into the bundle.

Choosing the wrong source leads to too few or too many items being merged.

Common Use Cases

Aggregators shine when you need to:

  • Send one daily digest instead of many alerts
  • Total or average values across records
  • Build a single document from many rows
  • Group data before reporting

Avoiding Common Mistakes

Watch out for these pitfalls:

  • Forgetting to set the source module correctly
  • Aggregating empty results, which can produce blank output
  • Combining items that should have stayed separate

Always test with sample data to confirm the bundle looks right.

Quick Check

Test your understanding of aggregators and arrays.

Recap

You learned to work with aggregators and arrays:

  • Arrays are ordered lists of values flowing through a workflow
  • Aggregators combine many items into one bundle
  • Use text, numeric, and array aggregators for different needs
  • Group items by a key and pair iterators with aggregators
  • Always set the correct source and test with sample data

Aggregation lets your workflows summarize and organize collections with ease.

常见问题解答

「使用聚合器与数组」课时是免费的吗?

是的 — 「使用聚合器与数组」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 No-Code Automation 课程的其余内容,请升级到 CoddyKit PRO。 No-Code Automation 课程共包含 4 节课。

「使用聚合器与数组」这节课中我会学到什么?

学习如何使用聚合器和数组将多个项目合并为单个数据包,让工作流能够高效地汇总、分组和处理数据集合。 你通过在浏览器中直接运行的动手代码来练习 No-Code Automation,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 No-Code Automation 需要有经验吗?

无需任何先前经验。CoddyKit 上的 No-Code Automation 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「使用聚合器与数组」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 No-Code Automation 课中编写并运行代码吗?

能。每节 No-Code Automation 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 添加筛选器与路径
  2. 数据映射与转换
  3. 迭代器与循环工作流
  4. 使用聚合器与数组
← 返回 No-Code Automation