In this Salesforce tutorial, we will learn how to Display Child Account Contacts Using a Salesforce Screen Flow. This screen flow allows the user to view the child account’s contacts on the parent account record page.
While working as a System admin for an organization that provides business solutions, I was assigned the task of creating quick access to the contacts of child accounts of the Account record so that users could access and view the contacts of child Accounts of the current account record page.
To solve this, I decided to create a screen flow that will get the Contacts of the child account record on the account record that the user currently has opened. This screen flow will be accessible through a flow component on the Account record page.
Create Screen Flow to display child Account Contacts in Salesforce
To Create a Screen Flow to display child Account Contacts in Salesforce, navigate to the Setup page of Salesforce and follow the below steps.
1. On Salesforce’s Setup page, go to the Quick Find box and search, then select Flows under Process Automation.

2. In the flow setup window, click on the the New Flow.

3. In this step, select the option Screen Flow and click on the Create button.

4. Now, in the flow builder, we will create a variable to store the record id. We will pass this record id into the flow when the flow is embedded on the lightning record page.
Click on the toggle icon, then click on the New Resource button.

5. Enter the following fields to create the resource that will store the id of the record.
- Select the Resource Type as a Variable.
- Enter the API name as recordid.
- Select the Data type as Text.
- Activate the checkbox available for input.
- At last, click on the Done button.

6. In the Screen flow, click on the “+” icon and select the component Get Records.

7. In this window, select and enter the below fields to create the get record component to fetch the child account record.
- Enter the Label and API Name for the get record component.
- In the Object field, select the object Account.
- To define the condition for the get record, enter the Field as ParentId, Operator as Equals, and Value as recordid variable that we have created in the above steps.
- At last, activate the radio button All Records.

Till now, we have created the step to get the parent account record, but what we need is a child record that is the contact of the child account record.
Now, we are going to create the get contact step, which will get us the contact whose account ID exists in the Account that we get from the get step above.
Here, the get Account component will give us a collection of records, but we can’t use that as an operator to get the contact ID. To do so, we will create a loop that will return a variable in a text collection.
8. Again, create a new resource and select Resource Type as a Variable and API Name as AccountIDs. Then, select the Data Type as Text and activate the checkbox Allow multiple values.
At last, click on the Done button.

9. Now, we will add a loop to this flow, and for that, select the Loop element.

10. Enter the Label and API name of the Loop, then in the section Select Collection Variable, select the variable Account from Get_Accounts.

10. Add an Assignment element to the loop. This assignment will collect the IDs from the record collection and add them to our text collection; here, we are pushing a complex variable to a simple variable.

11. Enter the Label and API Name for the Assignment. Then, in the section Set Variable Values, select the Variable as Account ID (text), Operator as Add, and Value as Current item from loop, Loop in Account (loop name).

12. Now, add a Get Records component in the flow to get the contacts of the child account.

13. In this step, enter the Label and API Name. Here, I have entered the Label as Get Contact Records, and the API Name will be auto-filled according to the entered label.
Select the Object as Contact. After this, define the condition to get the record, and for that, select the Field as AccountId, Operator as In, and Values as Account_ids (text variable).
At last, activate the radio button All records.

14. After adding the get contact element, we will add a Screen component that will display the details of contacts in a table.

15. In the New Screen window, enter the Label and API Name for the screen and then drag and drop the Data Table component from the left sidebar to the screen region.

16. After that, enter the Label and API Name for the data table, and under the heading Configure Data Source, select the Source Collection as Contacts from Get_Contacts_Records.

17. To add the column to the data table, click on the Configure Columns dropdown on the right sidebar. Under the heading Column Options, select the Source field. After selecting each source field, click on the Done button.
The selected source fields will be displayed as columns in the data table. I have added the columns First Name, Last Name, Title, and Account ID to this table.

18. After creating the data table, click on the Done button.

19. Till the flow is created, now click on the Save button.

The flow is created, and in the further steps, we will debug the flow to check if it is working and the errors in the flow.
Debug the created Screen flow
Follow the below steps, to debug the flow.
1. Click on the Debug button at the top.

2. In the record, enter the ID of the account record from which you want to get the contacts list. You will get the ID from the 15-digit code in the URL that will be visible when you open the parent account record.
After entering the ID, click on the Run button.

3. As we can see, the flow is debugged successfully, and we got the list of contacts from the child account in the data table.

4. After debugging the flow, click the Activate button to activate it.
In the next section, we will add the flow to the record page from where users can view the displayed records in the screen flow data table.
Add the Screen flow to the Record page
To add the created screen flow to the record page, navigate to the Accounts tab and follow the below steps.
1. In the Accounts tab, open an account record.
2. On the record page of the Account, click on the settings icon at the top, and from the options, select Edit Page.

3. When we click on the Edit page, the record page opens in the Lightning app builder.
In the app builder, go to the components section on the left-hand side, then drag and drop the Flow component to the template region.

4. On the right side of the screen, select the created flow in the Flow lookup field. Then activate the checkbox Pass record ID into this variable; otherwise, the flow will return all contacts of the org.
At last, click Save to apply changes.

Now, on the record page, we can see the table displaying the contacts of the child account of the Account record.

In this way, we can Display Child Account Contacts using a Salesforce screen flow, by following the above steps.
Conclusion
In Salesforce automation, flows are helpful in performing various data operations, such as updating and creating a record, and automation, like sending emails and displaying the fetched records.
In the above steps, we have learned about creating a flow to display child account contacts in Salesforce. With the same flow structure, you can fetch the records of child records and display them on the Parent object record page.
You may like to read:
- How to Create an Email Template In Salesforce Flow
- How to Delete a Flow in Salesforce
- How to Add Account Team Members in Salesforce
- How to Create a Note with Salesforce Flow
- How to Add Record Type in Salesforce Flow
- Auto-Assign Members to Account Team Using Salesforce Flow
- How to Create Contacts in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.