Ampscript is a very easy way to personalize emails dynamically in Salesforce Marketing Cloud.
When you have a “Sendable Data Extension”, we are able to populate the data in the fields by adding fieldname between double percentage (%%) signs.
Here is an example;
Let’s say our Sendable DataExtension contains the following records.
CustomerID | FirstName | LastName | EmailAddress |
2837469 | MUSTAFA | Unlukara | customer1@domain1.com |
7394850 | Jennifer | McKara | customer2@domain2.com |
5748943 | HUNTER | customer3@domain3.com | |
5678674 | Joe | Kara | customer4@domain4.com |
3254569 | MIKE | customer5@domain5.com |
We want to start emails with the following format,
Dear FirstName,
In our data extension, we do not have Proper case for values. Some first name values are missing.
We need to send First names in a proper case, and for the missing values we need to use “Valued Customer” text, instead of sending emails with missing first name.
Here is the Ampscript solution code of the personalization ampscript.

“Valued Customer” is added by IIF statement when the first name value of the customer record is missing.