#022. 5 AmpScript functions every SFMC user should know!

Hey Smart Marketers!

I told you last week that Nobody needs a Query but that doesn’t mean you should ignore anything related to coding or scripting…

Even if you’re not a developer, you should be able to handle simple use cases with AmpScript.

To get you started on this topic, I selected 5 AmpScript functions that can be very helpful.

Let’s dive in!

#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)

To learn more about Ampscript, I strongly recommend bookmarking the AmpScript Guide in your browser. It was already one of my favorite blog to unlock SFMC features back in October!

Have a nice week!

Stand out in SFMC's jungle

Every week, get tips about Salesforce Marketing Cloud.


Smarter, together