+ Start a Discussion
pavas singhalpavas singhal 

How to extract only the first name using AMP Script

Hi,


There is a text Field which stores value in the format: Last name, First name

I need to extract only first name from this field to be used in One of the email templates in marketing cloud

 
LBKLBK
Easy way out is to use a formula field to get the First Name.

You can use the formula field in your AMP Script.

Here is a sample formula.
TRIM(MID(
Full_Name__c ,
FIND(",", Full_Name__c)+1,
LEN(Full_Name__c) - FIND(",", Full_Name__c)))
I have assumed that your name field is called "Full_Name__c". Change it accordingly to meet your requirement.