In Salesforce automation, we use flows to automate the data process in the org, like creating, deleting, or updating a record using a flow. In this Salesforce tutorial, we will learn about creating a related Record from a Salesforce flow.
Create a Related Record from a Salesforce Flow
There are two ways to create a related record using the flow in Salesforce:
- Create a Related Record using the Screen flow
- Create a Related record using the Record Triggered flow
Create a Related Record from a Salesforce Screen Flow
To create a related record from Screen flow, navigate to the Setup page of Salesforce and follow the below steps.
1. On the Setup page, go to the Quick Find box, then search and select Flows.

2. In the Flows setup window, click New Flow.

3. Select the option Screen Flow and click Create.

4. In the flow, click on the “+” icon and add the Screen element.

5. In the New Screen, enter the Label and API Name for the screen, then add the Text component to the screen.

6. Here, I have added two text components with the labels First Name and Last Name. These text components will take input from the users to create contact records.
After this, activate the Require checkbox and click Done.

7. Add a Create Records element to the screen flow.

8. Enter the Label and API Name for the Create record element. Then, activate the radio button. Use separate resources and literal values.
In the Object field, select the related record object (Contact).

9. In the section, Set Field Values for the Contact, map the object fields with the text components that we have created in the screen element in the above steps.

10. Add another field, AccountId, that will relate the created contact to the account. In the value field, click and select the option New Resource.

11. Enter the details to define the new resource.
- Select the Resource Type as a Variable.
- Enter the API Name as RecordId.
- Enter the Data type as Text.
- Activate the checkbox available for input.
- At last, click Done.

12. Now the screen flow is completed, here click on the Save button.

13. Enter the Flow Label and the Flow API Name will be auto-filled according to the entered label. After this, click Save.

14. Click on the Activate button to activate and use this flow.

Add the Screen flow to the record page
In this example, this screen will create related records (contacts) for the account object, so I’ll add this flow to the account record page.
To add this flow on the record page follow the steps below.
1. Navigate to the Accounts tab -> select any record -> click on the settings icon -> select Edit Page.

2. In the Lighting app builder, drag the Flow component from the left sidebar to the template region.
3. In the right-hand sidebar, select the created flow in the Flow field, then activate the checkbox Pass record id into this variable.
After this, click Save to apply changes.

4. On the Account record page, enter the first name and last name in contact details, then click Next.

5. Now, the contact will be created, and it can be viewed in the Contacts of the account record.

In this way, we can create a related record from a Salesforce Screen Flow by following the above steps.
Create a Related record using the Record Triggered flow
To create a Related record using the Record Triggered flow, navigate to the setup page of Salesforce and follow the below steps.
1. Navigate to the Setup page, then search and select Flows in the quick find box under the heading Process automation.
2. In the Flows setup window, click on New Flow.

3. In this step, select the option Record triggered flow and click Create.

4. In the Object field, select Account (parent object). For the trigger condition, select the option, A record is created or updated.
Select the Condition Requirements as All Conditions Are Met (AND).
Here, the defined condition is that the trigger will run when the Active field is selected as True (yes).

5. Add a Create Record element to the flow.

6. Enter the Name and API Name for the create record element.
In the section, How to set the record, select the option Use separate resources and literal values. Then, in the Object field, select the object of the related record (Contact).

7. In the section Set Field Values for the Contact, set the Fields with their Values. In this flow to create the Contact record in Account, I have set the AccountId field with the value Record.Account ID, and another field is the Last Name field with the value Record.Account Name.
The last name will take the name of the parent object record, which can be modified later in the record page.

8. Click on the Save button at the top.

9. Enter the Flow Label to save the flow, and the Flow API Name will be auto-filled according to the entered flow label.
After this, click the Save button.

10. Activate the created record-triggered flow, and for that, click the Activate button.

After activation, when the applied condition in the flow will trigger the related record will be created in the parent object record.
In this way, we can create related records in Salesforce using the Record triggered flow by following the above steps.
Conclusion
In Salesforce CRM, flows help enable the automation of various processes; with this automation, we create a related record. In the above steps, we have created the related record of Contact for the parent Account record using the Screen flow and record-triggered flow.
By following the above steps, you will be able to use the screen flows and record-triggered flows to create the related record of the parent object record in your Salesforce instance.
You may like to read:
- How to Use Salesforce Flow in List View
- How to Create a Case Related to an Account using Flow in Salesforce
- How to Update Related Records using Salesforce Flow
- Automatically Add Users to Public Group Using Salesforce Flow

Abhijeet is a skilled Salesforce developer with experience in developing and integrating dashboards, data reports, and Salesforce applications. He is also skilled at optimizing processes and flow automation processes, coding, and executing complex project architecture. Read more about us | LinkedIn Profile.