> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Work with Records and Collections

Avonni Flow actions for records: convert a lead, create a file, total or pick records, and turn a record collection into timeline, calendar or picklist data.

These actions work on the records your flow already holds, usually right after a **Get Records** element. They create or convert records, calculate across a collection, and reshape records into the data an Avonni screen component reads.

{% hint style="info" %}
New to Avonni actions? Start with [Use an Avonni Action in a Screen Flow](https://docs.avonnicomponents.com/flow/actions/use-an-action-in-a-screen-flow.md), or find the right action in [Which Avonni Action Do I Need?](https://docs.avonnicomponents.com/flow/actions/which-action-do-i-need.md).
{% endhint %}

## Create and convert records

Act on a record from a screen flow, no Apex needed.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Convert a Lead in a Screen Flow</strong></td><td>Convert a Lead into an account, contact and opportunity from a screen flow with the Avonni Convert Lead action, then link the rep to the new records.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FvyyXjg0TsuDz39iXI8Rw%2Fcover-convert-lead.png?alt=media">cover-convert-lead.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/convert-lead.md">Convert a Lead in a Screen Flow</a></td></tr><tr><td><strong>Create a File from Flow Data and Attach It to a Record</strong></td><td>Create a Salesforce File from flow data with the Avonni Create File action, such as a CSV of an account's closed cases attached to the account.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fte3Lu6Zb3fNOwWUbx40B%2Fcover-create-file.png?alt=media">cover-create-file.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/create-file.md">Create a File from Flow Data and Attach It to a Record</a></td></tr></tbody></table>

## Calculate and pick from a record collection

Get a total, an average or one record out of the records you queried.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Calculate a Sum or Average on a Record Collection</strong></td><td>Use the SObject Collection Math action to calculate a sum, average, count, median or range on a number field of a record collection, without a loop.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FCLsOaVBNaMFYgqYMAxCs%2Fcover-sobject-collection-math.png?alt=media">cover-sobject-collection-math.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/sobject-collection-math.md">Calculate a Sum or Average on a Record Collection</a></td></tr><tr><td><strong>Get One Record from a Record Collection</strong></td><td>Use the SObject Collection Get Record action to pick one record from a record collection in a flow: the first, the last, one by position, or one by field value.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FSikLHstzsbiAOq4RxQBz%2Fcover-get-record-from-sobject-collection.png?alt=media">cover-get-record-from-sobject-collection.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/get-record-from-sobject-collection.md">Get One Record from a Record Collection</a></td></tr><tr><td><strong>Join Record Values into One Text Value</strong></td><td>Use the SObject Collection Join action to turn one field of a record collection into a single text, such as a comma-separated list of open deal names.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FAdZWt3VuAL11DpecVi2Y%2Fcover-sobject-collection-join.png?alt=media">cover-sobject-collection-join.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/sobject-collection-join.md">Join Record Values into One Text Value</a></td></tr></tbody></table>

## Turn records and text into collections

Build the text collection a picklist or a chip list reads.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Turn Records into a Text Collection</strong></td><td>Use the SObject Collection to Text Collection action to pull one field from a record collection into a Text Collection, for example to fill a dropdown of deals.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FQTV98afjK9CnXbzWXQ6F%2Fcover-sobject-collection-to-text-collection.png?alt=media">cover-sobject-collection-to-text-collection.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/sobject-collection-to-text-collection.md">Turn Records into a Text Collection</a></td></tr><tr><td><strong>Split Text into a Text Collection</strong></td><td>Use the Text split to Text Collection action to split one text, such as a semicolon-separated list of loss reasons, into a Text Collection for a dropdown.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FSqf0ClgfgCWHQVyxermM%2Fcover-split-text-to-text-collection.png?alt=media">cover-split-text-to-text-collection.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/split-text-to-text-collection.md">Split Text into a Text Collection</a></td></tr></tbody></table>

## Feed a timeline or a calendar

Map your records to the items, events and marked dates these components display.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Show Tasks, Events and Cases in One Avonni Timeline</strong></td><td>Use the SObject Collection to Activity Timeline Items action to merge an account's Tasks, Events and Cases into one Avonni Timeline in a screen flow.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FaczSvjkqgc9oWbXF7hoF%2Fcover-sobject-collection-to-activity-timeline-items.png?alt=media">cover-sobject-collection-to-activity-timeline-items.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/sobject-collection-to-activity-timeline-items.md">Show Tasks, Events and Cases in One Avonni Timeline</a></td></tr><tr><td><strong>Show Records from Several Objects on the Avonni Calendar</strong></td><td>Use the SObject Collection to Scheduler Events action to show visits and work orders from several objects on one Avonni Calendar in a screen flow.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F0siKWPuaKtfmLxbAdCwU%2Fcover-sobject-collection-to-scheduler-events.png?alt=media">cover-sobject-collection-to-scheduler-events.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/sobject-collection-to-scheduler-events.md">Show Records from Several Objects on the Avonni Calendar</a></td></tr><tr><td><strong>Mark Record Dates on the Avonni Date Picker</strong></td><td>Use the SObject Collection to Calendar Marked Date Collection action to mark the days of visits or deadlines on an Avonni Date Picker in a screen flow.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FrI7nFPaoAzZQaGFe9BsB%2Fcover-sobject-collection-to-calendar-marked-date-collection.png?alt=media">cover-sobject-collection-to-calendar-marked-date-collection.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation/sobject-collection-to-calendar-marked-date-collection.md">Mark Record Dates on the Avonni Date Picker</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/actions/data-manipulation-and-transformation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
