5 AmpScript functions every SFMC user should know!

 

#1 Propercase()

This is one of the most used functions.

You input a string and Propercase will capitalize the first letter. If you have a letter character following a non-letter character, 2 separate words for example, it will capitalize the letter character too.

Example: ProperCase("smart marketer") -> Smart Marketer

#2 DateAdd()

Do you want to send an email exactly 1 month before the subscriber anniversary?

Send a reminder one week before an event?

Send a survey 15 days after purchase?

You’ll end up using the DateAdd function.

DateAdd returns a date when you input 3 arguments: a date, an interval (integer), the part of the date you use the interval on (Year, Month, etc.)

Example: DateAdd(@SubscriberAnniversary, -1, "M")

#3 Concat()

Some data lives better together… at least in an email.

Name and surname… for example.

You can also need to build URLs for a redirect.

Anytime you need to concatenate 2 or more strings, that’s the function you need. Use Concat and enter your strings as arguments.

NB: Don’t forget to add spaces in your arguments!

Example: Concat("Smart", " ", "Marketer") -> Smart Marketer

#4 RedirectTo()

We just talked about URLs. This function redirects a user to a specific URL.

Just use the URL as an argument and you’re all set. You can use a URL stored in a variable or a data extension.

Example: RedirectTo(@link)

#5 Lookup() or LookupRows()

Case 1: You want to retrieve a column value for a certain row.

Case 2: You need multiple column values from a single row.

You’ll just need to enter the data extension, the column, and the value for the rows to retrieve, and you can append additional values.

Example: Lookup("Data Extension Name","EmailAddress","SubscriberKey", @ValueSubKey)

Comments

Popular posts from this blog

What are the different Content Blocks in SFMC ?

What is the different email-sending options in SFMC with examples?

What are Profile Center and Subscription Center in SFMC