---
schema_version: "1"
id: c4641ed0fd009cee7f34559b06bcd28039d98e9d942ff4d667d9e68e00ddf368
title: Working with Data in a Flow
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_build_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_build_data.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 463591ece33df81cbf2dcbad60a792e056afdb82d835e536412ca57270f396ad
description: The real power of a flow is that it can automate updates to your data, whether the data lives inside your Salesforce org or in an external database. In a flow, you can look up values from records, connect to external systems, create records, update records, and delete records.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Working with Data in a Flow

The real power of a flow is that it can automate updates to your data, whether the data lives inside your Salesforce org or in an external database. In a flow, you can look up values from records, connect to external systems, create records, update records, and delete records.

### 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>

## Where to Start

Work through these topics to build a solid foundation for data operations in flows, or jump to the stage that matches what you're building.

  
| Stage | Topic | What You Learn |
| --- | --- | --- |
| 1\. Create Records | [Creating a Salesforce Record from a Flow](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_create.htm&language=en_US) | Choose between the Create Records element and a Quick Action element of type Create. Understand how they differ in field availability, required field indicators, and whether the created record's ID is stored for later use. |
| 2\. Validate Required Fields | [Creating Records with Required Field Validation Example](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_example_required_fields.htm&language=en_US) | Follow a complete example of a screen flow that identifies required fields, collects them from users, and handles errors so that records are created without REQUIRED\_FIELD\_MISSING failures. |
| 3\. Update Records | [Update Salesforce Records from a Flow](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_update.htm&language=en_US) | Update one record or many. Compare the two Update Records element options and Quick Action to choose the right approach based on how your flow identifies records and supplies new field values. |
| 4\. Clone Records | [Clone Records with a Create Records Element](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_clone.htm&language=en_US) | Use a parent-child flow pattern to duplicate a record along with all of its field values, including fields that a standard Get Records element wouldn't retain. |
| 5\. Get Related Records | [Get Related Salesforce Records from a Flow (Beta)](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_get.htm&language=en_US) | Retrieve a parent record and its related child records in a single Get Records element, instead of chaining multiple elements together. |
| 6\. Aggregate Collections | [Sum or Count Items in Collections with the Transform Element](https://help.salesforce.com/s/articleView?id=platform.flow_build_logic_transform_sum_or_count.htm&language=en_US) | Use the Transform element to calculate a total or count from a collection's field values, and assign the result to a target variable—no custom code required. |
| 7\. Join Collections | [Join Collections in a Flow](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_logic_transform_join.htm&language=en_US) | Combine two related source collections into one target collection using join keys in the Transform element, for example to merge order data from an external system with Salesforce records. |
| 8\. Optimize for Scale | [Bulkified Record Processing to Avoid CPU Limits Example](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_example_bulkified_processing.htm&language=en_US) | See a before-and-after comparison that shows why performing DML inside a loop causes APEX\_CPU\_TIME\_LIMIT\_EXCEEDED errors, and how to refactor the flow to collect records during the loop and perform a single DML operation after it completes. |

## IN THIS SECTION

- **[Creating a Salesforce Record from a Flow](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_create.htm&release=264.0.0&type=5)**  
    To create a Salesforce record, use the Create Records element. You can also use a Quick Action element of type Create, but it has limited functionality.
- **[Identify Required Fields](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_example_required_fields_identify.htm&release=264.0.0&type=5)**  
    Before building a flow, identify the required fields for the object's records. There are two options: use Schema Builder or create a record on the object, but don't save it. Either option shows the required fields, but Schema Builder also shows system populated fields that you don't include in a flow.
- **[Creating Records with Required Field Validation Example](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_example_required_fields.htm&release=264.0.0&type=5)**  
    Build a screen flow that captures all required fields and creates records without REQUIRED\_FIELD\_MISSING errors. This example demonstrates techniques for identifying required fields and managing errors in flows.
- **[Avoid Overwriting Required Fields When a Screen Flow Updates a Record](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_example_required_fields_avoid_blank_overwrite.htm&release=264.0.0&type=5)**  
    When your screen flow collects field values and updates an existing record, prevent blank screen input from overwriting required fields and causing REQUIRED\_FIELD\_MISSING errors.
- **[Bulkified Record Processing to Avoid CPU Limits Example](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_example_bulkified_processing.htm&release=264.0.0&type=5)**  
    Learn how to refactor flows to use bulkification patterns that prevent APEX\_CPU\_TIME\_LIMIT\_EXCEEDED errors. This example demonstrates the difference between inefficient and optimized flow design.
- **[Clone Records with a Create Records Element](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_clone.htm&release=264.0.0&type=5)**  
    Use a parent flow and a child flow to clone a record and all of its values.
- **[Update Salesforce Records from a Flow](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_update.htm&release=264.0.0&type=5)**  
    To update field values on existing Salesforce records, use either the Update Records element or a Quick Action core action. The right element depends on what the rest of your flow is doing.
- **[Sum or Count Items in Collections with the Transform Element](https://help.salesforce.com/s/articleView?id=platform.flow_build_logic_transform_sum_or_count.htm&release=264.0.0&type=5)**  
    Aggregate data from a source collection to calculate the sum or count of items in that collection, and assign the result to a target data field.
- **[Join Collections in a Flow](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_logic_transform_join.htm&release=264.0.0&type=5)**  
    Combine source collections from related flow resources into one target collection.
- **[Get Related Salesforce Records from a Flow (Beta)](https://help.salesforce.com/s/articleView?id=platform.flow_build_data_get.htm&release=264.0.0&type=5)**  
    Access related records in complex data relationships.. Related records in the Get Records element are available in autolaunched flows.