Overview

As we dive into more complex AMPscript logic we may come across situations where we need to manipulate string values to achieve different things. We can do this by using the following functions listed below:

  • Lowercase(1)
  • Uppercase(1)
  • Propercase(1)
  • Trim(1)
  • Empty(1)

Examples

Lowercase Function
An example of when we might use this function is if a client wants us to render email copy in all lowercase letters. For example, let’s say that the client’s data contains values in in all uppercase letters. We can use the Lowercase function to convert the client’s data from uppercase to lowercase without having to manually update data in the data extension.


Uppercase Function
An example of when we might use this function is if a client wants us to render email copy in all uppercase letters. For example, let’s say that the client’s data contains values in all lowercase letters. We can use the Uppercase function to convert the client’s data from lowercase to uppercase without having to manually update data in the data extension.

Propercase Function
An example of when we might use this function is if a client wants us to render email copy using proper case formatting. For example, let’s say that the client’s data contains values in all uppercase letters. We can use the ProperCase function to convert the client’s data from uppercase to proper case without having to manually update data in the data extension.

Trim Function
There may be instances where the client provides data with undesired spaces. An example might be if the client has a field in the sendable data extension called fname. The client accidently uses “  John  ” in that field rather than “John”. In order to clean this up prior to using it in the email we use the Trim function to strip out unwanted spaces before and after the data value.

Empty Function
This function is used often to evaluate whether a variable is empty or not. You’ll notice that this function is combined with other functions to evaluate and personalize content. In this example, we check to see if @name is empty or not. If so, then set the @name variable to “Valued Customer” to use as a fallback.


Gallery