This article guides you through using a Salesforce Record-Triggered Flow to automatically count the total number of contacts directly linked to an account whenever a contact is created or updated. It also provides instructions on how to update the account with the accurate count of contacts.
Business use case: Track the number of active Contacts per Account for segmentation. When Contacts are added or removed, the Contact Count field on the Account updates automatically.
This article explains how to use a Salesforce Record-Triggered Flow to count the contacts related to an account and store that count in a custom Contact Count field on the Account object. The steps cover creating the field, building the flow, and activating it.
Save and activate your flow. The setup is now complete.
Written by: Tom Bassett | Forum Ambassador
Tom Bassett is a Solution Architect at Trigg Digital and has 5+ years of experience with the Salesforce platform. He aspires for customers to gain the most out of the CRM and spreads the Ohana culture by supporting the wider Trailblazer Community with new feature ideas and providing answers to questions posted. He co-leads the London Architect Community group and also contributes to Salesforce Ben as an expert Author.
Submissions reflect only the opinions of the user who made available the Submission and not the opinions of Salesforce, regardless of whether the user is affiliated with Salesforce, and may contain or constitute products, services, information, data, content, and other materials made available by or on behalf of third parties ("Third Party Materials"). Salesforce neither controls nor endorses, nor is Salesforce responsible for, any Third Party Materials, including their accuracy, validity, timeliness, completeness, reliability, integrity, quality, legality, usefulness or safety, or any applicable intellectual property rights. Any Submissions made available through any message board or forum in response to posted questions, or that otherwise purport to answer any questions, including any questions about Salesforce or Programs, are made available for your general knowledge only and should never be relied upon as answers to your specific questions (even if an answer is marked as a "best" answer or with any similar qualifications). You should always contact Salesforce support for answers to your specific questions. Salesforce has no control over Submissions and is not responsible for any use or misuse (including any distribution) by any third party of Submissions.
If you have questions, tap into the wisdom of our entire Trailblazer Community here: https://trailhead.salesforce.com/trailblazer-community/feed
000395389

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.