> 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/sobject-collection-to-text-collection.md).

# SObject Collection to Text Collection

## Overview

This action helps you extract text values from a collection of Salesforce records (SObjects) and create a new collection containing only those text values.

## How it Helps

Imagine you have a collection of Contacts and need to create a list of their email addresses. This action lets you easily extract the "Email" field from each Contact record and create a new collection containing just the email addresses.

## When to Use It

This action is ideal for:

* **Creating a focused list of text values from your records.**
* **Simplifying data manipulation and extraction.**
* **Preparing data for use in components that require text collections (e.g., picklists, multi-select lists).**
* **Avoiding manual extraction of text values using loops or formulas.**

## Example

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F4hofp5ntvfA1n1lON2Or%2Fsobject-collection-to-text-collection-flow-canvas.png?alt=media" alt="Flow Builder canvas showing Start, then a Get Records element named Get Accounts, then an action named Extract Account Names, then a screen named Account Names, then End"><figcaption><p>The action sits between the element that produces the records and the screen that uses the names. Here a <strong>Get Records</strong> runs before it.</p></figcaption></figure>

To create a collection of Account names:

1. **Retrieve Accounts:** Use a "Get Records" element to fetch a collection of Account records.
2. **Configure the Action:** In **Source Collection**, pick the Get Records element or a record collection variable. In **Field Name**, pick **Name**. The field list fills once a source collection is set.
3. **Use the Text Collection:** The output is a Text Collection. Flow stores it automatically, and you reference it by the action's API name, for example `{!Extract_Account_Names}`, wherever a text collection is accepted. To keep it in a variable of your own instead, turn on **Manually assign variables** and assign the output, named **output**, to a Text Collection variable.

## Key Considerations

* **Source Collection:** Ensure you have a valid collection of SObjects.
* **Field Name:** Choose the field that contains the values you want to extract. Any field type can be picked: the value is converted to text as it is stored, so a number comes back without formatting and a date or date/time as a raw GMT value such as 2026-08-14 18:22:23.
* **Empty values are skipped:** A record with no value in the field adds nothing to the output, so the text collection can hold fewer entries than the source collection, and its positions do not line up with the records.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
