You are here:
Create a Child Flow to Clone a Record
Create a flow to clone a record with all field values stored in a record variable. This flow is called by a parent flow using a Subflow element. This flow returns the cloned record to the parent flow.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: | Manage Flow |
Note When you select the Automatically store all fields option in a Get Records element, the
flow determines what fields you reference within that flow, and stores values only for the
referenced fields. Therefore, if you use a Create Records element within the parent flow to
clone the record, only the field values referenced within the flow are copied to the new record.
When you use a child flow to clone the record, flow copies all fields that the running user has
edit access to.
Before you begin, review Read-Only Field Restrictions for Flow Record Processing
-
Open the Flows list view.
- From Setup, in the Quick Find box, enter Flows, and then select Flows.
- From the Automation app, select the Flows tab.
- From the Flows tab in any Lightning app, click the actions menu and select Open Flow.
-
Create an autolaunched flow.
- From Setup, click New Flow, select Autolaunched Automations, and then select Autolaunched Flow (No Trigger)..
- From the Automation app, click New, selectAutolaunched Automations, and then select Autolaunched Flow (No Trigger).
-
Add an input variable to store the record variable containing the original record.
-
To open the Toolbox, click
- Click New Resource, and then select Variable.
- Enter an API name and description.
- For Data Type, select Record.
- For Object, select the object of the record to clone.
- for Availability Outside the Flow, select Available for input.
For example, to clone a case record, add a caseToClone record variable.Field Value API Name caseToClone Description Stores a case record that contains the field values of the original case record, and is passed into the flow. Data Type Record Object Case Availability Outside the Flow Available for input -
To open the Toolbox, click
-
Add a record variable to store the new record values.
- Click New Resource, and then select Variable.
- Enter an API name and description.
- For Data Type, select Record.
- For Object, select the object of the record to clone.
- For Availability Outside the Flow, select Available for output.
For example, create a variable to store a new case record and return it to the parent flow by adding a newCase record variable that available as output from the flow.Field Value API Name newCase Description Stores the field values of the original case record and is available as output from the flow. Data Type Record Object Case Availability Outside the Flow Available for output -
Add an Assignment element to clear the value of the record’s ID.
-
Click
, and select Assignment.
- Enter a label, API name, and description for the element.
- For Variable, select the record variable that holds the new record.
- For Operator, select Equals.
- For Value, select the record variable that holds the record to clone.
- Click Add Assignment.
- For Variable, select the primary ID field of record variable that holds the new record.
- For Operator, select Equals.
- For Value, select Blank Value (Empty String).
For example, to set the value of the new record variable to the record passed into the flow and to set its case ID to an empty string, add an Assignment element.Field Value Label Set newCase Values API Name SetNewCaseValues Description Sets the newCase record variable to caseToClone, and then sets newCase’s case ID to an empty string. Variable newCase > Entire Resource Operator Equals Value caseToClone > Entire Resource Variable newCase > Case ID Operator Equals Value Blank Value (Empty String) -
Click
-
Add a Create Records element.
-
Click
, and select Create Records.
- Enter a label, API name, and description for the element.
- For Object, select the object of the record to create.
- For How Many Records to Create, select One.
- For Record, select the record variable created in step 4.
For example, add a Create Records element and configure it to create a record using the field values stored inthe newCase record variable.Field Value Label Clone Record API Name CloneRecord Description Creates a copy of the record in newCase, and stores the result in the newCase record variable. How to set record field values From a Record Variable How Many Records to Create One Record newCase The Case ID field of newCase now contains the new record’s case ID. -
Click
-
Save the flow.
For example, click Save and then use these values to save the flow.
Field Value Flow Label Clone Record with All Fields API Name Clone_Record_with_All_Fields Description Creates a copy of the record passed into the flow, with all fields. 
Click Save.
- Activate the flow.
This child flow is now ready to be called by the parent flow using a Subflow element.
Did this article solve your issue?
Let us know so we can improve!

