---
schema_version: "1"
id: 48d6cb9f35112075641ab2c52b2b04e07858fc143d5fcc4fb5cd9aa01ea26959
title: Add Values to a Collection Variable
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_resources_variable_populate.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_variable_populate.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f03907fec07584fd28724f7f0124b415af74578a1711b623e25eff5ac01e62c0
description: After you create a collection variable, populate it with values to reference throughout your flow. You can’t use a Get Records element to populate a collection variable, but there are some workarounds.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Add Values to a Collection Variable

After you create a collection variable, populate it with values to reference throughout your flow. You can’t use a Get Records element to populate a collection variable, but there are some workarounds.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

To use values from outside the flow, make sure that the collection variable is available for input. When the values come from outside the flow, the values can be set only when the flow interview starts.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
          <colgroup>
            <col style="width:33.33333333333333%">
            <col style="width:33.33333333333333%">
            <col style="width:33.33333333333333%">
          </colgroup>
          <thead class="slds-text-title_caps ">
            <tr class="">
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d75373e71">To add values that are stored in a...</th>
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d75373e74">Do this action...</th>
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d75373e77">For more information</th>
            </tr>
          </thead>
          <tbody>
            <tr class="">
              <td data-label="To add values that are stored in a..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e71 ">Screen component</td>

              <td data-label="Do this action..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e74 ">Add the field’s entered or stored value to a collection variable by using an
                Assignment element.</td>

              <td data-label="For more information" class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e77 ">
                <ul>
                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_screencmp.htm&amp;release=264.0.0&amp;type=5" title="Salesforce provides several standard screen components that extend the types of input fields available in screens.">Screen
                      components</a>
                  </li>

                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_assignment.htm&amp;release=264.0.0&amp;type=5" title="Set values in variables, including collection variables, record variables, record collection variables, and global variables.">Assignments</a>
                  </li>

                </ul>
              </td>

            </tr>
            <tr class="">
              <td data-label="To add values that are stored in a..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e71 ">Variable</td>

              <td data-label="Do this action..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e74 ">Add the variable’s stored value to a collection variable by using an Assignment
                element.</td>

              <td data-label="For more information" class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e77 ">
                <ul>
                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_variable.htm&amp;release=264.0.0&amp;type=5" title="Store a value that can be used or changed throughout the flow.">Variables</a>
                  </li>

                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_assignment.htm&amp;release=264.0.0&amp;type=5" title="Set values in variables, including collection variables, record variables, record collection variables, and global variables.">Assignments</a>
                  </li>

                </ul>
              </td>

            </tr>
            <tr class="">
              <td data-label="To add values that are stored in a..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e71 ">Record variable</td>

              <td data-label="Do this action..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e74 ">Add one of the record variable’s stored field values to a collection variable
                by using an Assignment element.</td>

              <td data-label="For more information" class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e77 ">
                <ul>
                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_variable.htm&amp;release=264.0.0&amp;type=5" title="Store a value that can be used or changed throughout the flow.">Variables</a>
                  </li>

                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_assignment.htm&amp;release=264.0.0&amp;type=5" title="Set values in variables, including collection variables, record variables, record collection variables, and global variables.">Assignments</a>
                  </li>

                </ul>
              </td>

            </tr>
            <tr class="">
              <td data-label="To add values that are stored in a..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e71 ">Record collection variable</td>

              <td data-label="Do this action..." class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e74 ">Loop through the record collection variable. Within the loop, add one of the
                loop variable’s stored field values to a collection variable by using an Assignment
                element.</td>

              <td data-label="For more information" class="slds-cell-wrap" style="vertical-align:top;" headers="d75373e77 ">
                <ul>
                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_variable.htm&amp;release=264.0.0&amp;type=5" title="Store a value that can be used or changed throughout the flow.">Variables</a>
                  </li>

                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_loop.htm&amp;release=264.0.0&amp;type=5" title="Start a loop path for iterating over items in a collection variable. For each iteration, the flow temporarily stores the item in the loop variable. To run actions on each item’s field values, use other elements in the loop.">Loops</a>
                  </li>

                  <li>
                    <a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_assignment.htm&amp;release=264.0.0&amp;type=5" title="Set values in variables, including collection variables, record variables, record collection variables, and global variables.">Assignments</a>
                  </li>

                </ul>
              </td>

            </tr>
          </tbody>
        </table>

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_example.png)

Example

You’re designing a flow that sends an email to all employees living in specific location. You create a record collection variable that collects all users who lives in San Francisco. Then you use the send email action that the flow sends an important update to those employees. For more information, see [Send an Email with an Attachment in an Autolaunched Flow Example](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_send_email_example_autolaunch_with_attachments.htm&release=264.0.0&type=5 "Use the Send Email action to send an email with an attachment to all employees living in a city. For example, you want to send an important update to all employees living in San Francisco and add attachments to your email.")