Loading

Formula to create a Text String from selections made on a group of checkboxes

Publiseringsdato: Jan 26, 2026
Beskrivelse
Sometimes, it is desired to have a field that needs to display the responses from the selections made from a group of checkboxes on the record detail page.

For instance:

There is an organization that tracks employee skills (Skill 1, Skill 2, Skill 3, Skill 4, and Skill 5) as checkboxes on contact records, and they need to see all the responses of an employee as a formatted string on the record page. If no skills are available on the contact record, "No Skills" text should be displayed.
Løsning
In order to fulfill this requirement, we need to create a Formula field on the Contact record as below:

Step 1. Go to the Object Manager and select Contact object

Contact.PNG

Step 2. Click on the New button under Fields & Relationships and select Formula as the Data Type and click n Next

Formula.PNG

Step 3. Provide a Field Label as Employee Skills to the formula field and select Text as the Formula Return Type and click Next button

Employee Skills.PNG

Step 4. Under the Formula Editor page, select Advanced Formula and enter the formula as: 
SUBSTITUTE(
IF(Skill_1__c = TRUE, "Skill 1, ", NULL) +
IF(Skill_2__c = TRUE, "Skill 2, ", NULL) +
IF(Skill_3__c = TRUE, "Skill 3, ", NULL) +
IF(Skill_4__c = TRUE, "Skill 4, ", NULL) + 
IF(Skill_5__c = TRUE, "Skill 5, ", NULL) +
"No Skills", ", No Skills", NULL)
where, Skill_1__c, Skill_2__c, Skill_3__c, Skill_4__c and Skill_5__c are API names of the checkboxes


Test1.jpg

Step 5. Click on the Check Syntax button available at the bottom left of the editor to validate the entered formula

Check Syntax.PNG

Step 6. Scroll down to the Blank Field Handling section available at the bottom of the page and make sure to select Treat blank fields as blanks as the option and click Next

Blank Field.PNG

Step 7. Select the appropriate Profiles for the Field Level Security and click on Next button

Field Level.PNG

Step 8. Select the appropriate Page Layouts and click on the Save button

Page Layout.PNG

Contact.png


___________________________________________________________
 

Written by: Ajaypreet Singh Saini | Salesforce Answers Leader
Ajaypreet Singh Saini is working as a Salesforce Implementation Specialist at Grantbook. Prior to Grantbook, Ajaypreet served as a Salesforce Administrator for 2 years working on Sales Cloud where he was responsible for configuring and administrating complex processes and maintaining security of Salesforce Instance.

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 purports 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

 
Knowledge-artikkelnummer

000394769

 
Laster
Salesforce Help | Article