Using Salesforce Flow, we can automate the processes to assign team members to a particular account.
In this Salesforce tutorial, we will learn about account team members and how to auto-assign members to account team using Salesforce Flow using real-time scenarios and explanations.
What is an account team member in Salesforce?
A team was set up in Salesforce to help manage accounts. A team is a group of people (or users) who work on an account together—whether that account involves an existing client, prospect, pitch, or any other type of project. They also have record-level access sharing, reporting, and process automation.
Let’s take a Scenario while working as a Salesforce Admin for a US-based Organization that provides software solutions. I was assigned the task that whenever a new account is created with the account type as a technology partner, you have to automatically assign Sales Profile’s users to an account team member for the newly created account.
Auto-Assign Members to Account Team Using Salesforce Flow
Using the above scenario and the following steps, we can assign account team members using Salesforce Flow.
Prerequisites:
We need to Enable the Account Team Member feature from setup and add it to the Account Page Layout of the Related List section.
For that, go to the Home tab -> In Quick Find Box, search for Account Team -> Click on it, and you will see the option to Enable Account Team.
You can read the whole article on How to Add Account Team Members in Salesforce.
Create Record Triggered Flow:
1. Log in to Salesforce Org. -> Click on the Setup -> Home Tab -> In Quick Find Box, Search for Flows. You will see an option under Process Automation -> Click on Flows.
- Then, click on the New Flow button to create a new flow.
- When a new account is created, we will assign a team member to the account record. To do so, we must select the Record-Trigger flow and click on the Create button.
- In our scenario, the flow should trigger when we create an Account record. That’s why I have selected the Account in the Object field. In Configure Trigger, I have selected A Record is Created or Update because when we create the record, the flow should trigger.
Now, we will create the following elements in the flow according to the flow diagram displayed in the following Flow Diagram.

1. Record Trigger Flow:
2. Then, we need to verify whether the account that is going to be created is new or not. For that, we will create a formula by creating a New Resource. To create a new resource, click on the Manager tab, and then you will see the New Resource option. Click on it.
Then, in the Resource Type, select Formula Type. Enter the API name. Select Data Type as Boolean and enter the ISNEW() function formula to check whether the record is new or not.
Then click on the Done button.

2. Decision Element(Account Criteria):
3. Now, we need to add a Decision ELement to check for account criteria based on which account team member will be added. After adding the decision element, enter the Label for it. The API Name will populate automatically.
- Then, enter the Label for Outcome. The Outcome API Name will automatically populate. Then, in the Condition Criteria, we have to add a condition for a selected outcome. When we select the account type as a technology partner and create a new account, we continue this process.
- Add Condition Requirements as follows:
- $Record->Account_Type = Equals = Technology Partner (Picklist Value from Account Type).
- newAccountRecord(API Name Formula Resource) = Equals = True.
Then click on the Done button.

3. Get Records Element(Profile Details):
4. Now, we need to fetch User records based on some criteria. To do that, add the Get Records element by clicking on the ‘Add Element + icon‘, enter Label, and the API Name will populate automatically.
- Then, we are going to fetch user records for that in the Object Field. We need to select the Profile object. As per our scenario, we need to add Sales Profile users as an account team member. For that, we need to add conditions as follows:
- Name(Profile) = Contains = Sales.
- That means we are fetching only those user records that come under the Sales Profile.

4. Decision Element(Check Null Profile Records):
5. Now, we need to check whether the profile users we want to fetch have assigned Sales Profile by using the Decision Element.
- Here, we will check for the above element where we got records of Sales Profile is empty or not; if it is empty, then end the flow, and if it is not null, we need to check by using the following condition:
Fetch_User_Details_Based_on(API Name of Get Record) = Is Null = False.

5. Get Records Element(User Details):
6. Now, we need to fetch users’ records, which come under the Sales profile, by adding the Get Records Element. This element will only execute when the Sales profile has assigned users.
- After adding the Get Record Element, enter the Label, and the API Name will populate automatically.
- Select Object as User and add the following conditions to filter user records.
- ProfileId(User Fields) = Equals = (Select ProfileId from Get Profile records).
- IsActive = Equals = True.
Here, we also need to store all users’ records, so select the All Records Store option and then click the Done button.

6. Decision Element(Check Null User Records):
7. Now again, we need to add a Decision Element to check whether the user that we fetched the records that null or not. For that, add Not Null Users outcome and add the following condition:
- API Name(Get User Records) = Is Null = False.
If this condition is true, the next element will be executed; otherwise, we will add a loop element to the next step to check the collection of the user records and click the Done button.

7. Loop Element:
8. Now, we need to add a Loop Element to loop through the Get User Records if the null check is passed, that is, if records are not fetched.
Enter Label and add Get User records collection to the Collection Variable and click on the Done button.

9. Now, we need to create Resources to store the record of Account Team Members.
- Then, in the Resource Type, select Variable Type. Enter the API name that we will use as a value. Select Data Type as Record. In the Object field, select Account Team Members and click the checkbox for Available for Input and Output.
- Then click on the Done button.

10. Similarly, we need to create Resources to store the record of Account Team Members as a Collection.

8. Add Assignment Element:
11. Now we are going to assign values to the stored Account Team Members as follows:
Read/Write will show as an Edit value.
| Variable(AccountTeamMember) | Value |
| AccountId | $Record>Account>ID |
| Account(object) Team Member Access | Read/Write |
| Contact Access | Read/Write |
| Case Access | Read/Write |
| Opportunity Access | Read/Write |
| Team Role | Sales Manager |
| UserId | Select Id From Loop |

9. Add Bulk Assignment Element:
12. Now, we will add account team members who have assigned values to the AccountTeamMember Collection variable that we have created. For that, add Assignment Element and add the following condition:
AccountTeamMemberCollection = Add = AccountTeamMember.
Then click on the Done Button.

10. Create Records Element( Account Team Member):
13. Now, we will create records for the team member so that when the account is created with a specified condition, the Account team member will automatically be created with that account.
Here, we need to add the Create Record Element and then enter the Label and API Name. We want to Create Multiple Records, so we select Values to Create Multiple Records as Account Team Member Collection. Then, click on the Done Button.

11. Save Flow:
14. After setting up all labels and conditions, click the Save button to save the flow. For that, we need to enter the Flow Label. The API Name will automatically populate as we click the text box. The Description is optional; we can introduce our flow Shortly.
12. Activate Flow:
15. After Saving the flow, click on the Debug button. Then click on the Activate button; always remember to debug the flow before activating it. It’s good practice to use flow.

This is how we can create a flow for Auto-Assign Account Team Members Using Salesforce Flow.
Conclusion
Now, I hope you have an overview of the account team members. We have seen how to auto-assign account team members using Salesforce Flow, using real-time scenarios and explanations.
You may like to read:
- Automatically Assign PricebookId to Opportunities using Salesforce Flow
- How to Create a Case Related to an Account using Flow in Salesforce
- Display Child Account Contacts Using a Salesforce Screen Flow
- Migrate Workflows and Process Builder to Salesforce Flow

Shubham is a Certified Salesforce Developer with technical skills for Building applications using custom objects, approval processes, validation rule salesforce flows, and UI customization. He is proficient in writing Apex classes, triggers, controllers, Apex Batches, and bulk load APIs. I am also familiar with Visualforce Pages and Lighting Web Components. Read more | LinkedIn Profile