Loading

Extracting the First Email Address from a Semicolon-Separated String Using Salesforce Flow

Fecha de publicación: Aug 28, 2026
Descripción

An integration in Salesforce sometimes generates a string of multiple email addresses separated by semicolons and stores it in a custom text field, such as Contact_Email_Address__c, on the Contact record. A common requirement is to extract just the first email address from that string and store it in the standard Email field on the Contact record.

This article explains how to meet that requirement using a formula resource inside a Salesforce Flow.

Solución

In this use case, as the Email value population needs to happen on creation of Contact record, we use a Record-Triggered Flow to automatically extract the first email address out of a semicolon-separated list. Follow the steps below to build the automation.

Step 1: Open Setup

Login to your Salesforce account, click the Gear Icon on the top right corner of your screen, and select Setup.

Gear icon menu in Salesforce with Setup option highlighted

Step 2: Create a New Flow

From the Quick Find box, search for Flows and select the New Flow button.

Flows list view with New Flow button highlighted

Step 3: Choose Record-Triggered Flow

Under the Categories section, choose the Triggered option, then select Record-Triggered Flow to proceed.

Flow category selection screen with Triggered category highlighted

Record-Triggered Flow option selected from the Triggered category

Step 4: Configure the Start Trigger

On the Configure Start trigger, provide the following values:

ObjectContact
Trigger the Flow WhenA record is created
Condition RequirementAll Conditions Are Met (AND)
Optimize the Flow forFast Field Updates

Set the Logic as follows:

Contact_Email_Address__cDoes Not Equal

Note: Leave the Value input box empty in the logic above, since we don't want the Flow to trigger when Contact Email Address is blank.

Start trigger configuration showing Contact object, record created, and Contact Email Address does not equal blank condition

Step 5: Create a Formula Resource to Extract the First Email

Create a new Formula resource type for extracting the first email value from the Contact Email Address field. Substitute the values as follows:

Resource TypeFormula
API NameProvide a suitable API Name
DescriptionProvide a suitable Description
Data TypeText

Use the following formula:

`LEFT({!$Record.Contact_Email_Address__c} , FIND( ";" , {!$Record.Contact_Email_Address__c})-1)`

This formula finds the position of the first semicolon in the Contact Email Address string, then takes every character to the left of it — in effect isolating just the first email address in the list.

Formula resource configured with a Text data type using LEFT and FIND to extract the first email address

Step 6: Assign the Formula Result to the Email Field

Add an Assignment element, available when the + icon is selected. Provide a suitable Label and Description — a Description is optional but considered a best practice.

LabelAssign first email value
DescriptionProvide any suitable description

Set Variable Values as below:

{!$Record.Email}Equals{!Formula_ExtractEmail}

Assignment element setting the Contact Email field equal to the Formula_ExtractEmail resource

Completed flow canvas showing the trigger, formula resource, and assignment element

Step 7: Save the Flow

On the upper right side of the Flow canvas, click the Save button and provide a suitable Flow Label.

Save Flow dialog prompting for a Flow Label

Step 8: Activate the Flow

Click the Activate button next to the Save button to activate the Flow.

Activate button next to Save button on the flow canvas

Result

Contact record showing the Email field populated with just the first email address from the semicolon-separated list

____________________________________________________________________

Written by: Ajaypreet Singh Saini | Forum Ambassador

Ajaypreet Singh Saini is working as a Salesforce Implementation Consultant 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

Número del artículo de conocimiento

004754253

 
Cargando
Salesforce Help | Article