Concat Function

The Concat function concatenates strings together. You can concatenate as many values as you need together. A good use case would be to combine an AMPscript variable with a hard-coded string.

Example:

For example, if you have the salutation of an email that needs to be combined with a first name value:

					

%%[
set @firstName = “Jackson”

IF @firstName != “” THEN
   set @salutation = Concat(“Dear “, @firstName, “,”)
ELSE
   set @salutation = “Dear Customer,”
ENDIF

]%%
%%=v(@salutation)=%%

Output:

Dear Jackson,

Explanation:

In this example, we have a first name value of “Jackson” but this can be replaced with the First Name value from your sendable data extension. We used If function around the Concat function and set the variable for @salutation. If the @firstName variable is not null then we will use the Concat function to concatenate the hardcoded “Dear ” with the @firstName. If the @firstName value is empty then we’ll use the hardcoded value of “Dear Customer,”.

Note that in this Concat function example, we concatenated 3 strings: (1) “Dear “, (2) @firstName, and (3) “,” (a comma).

Leave a Reply

Your email address will not be published. Required fields are marked *