Author: houdiedownunder

  • Day 10 – Clean up special characters in names

    Challenge https://ampscript30.com/ampscript-challenge-day10/ To clean up the special characters in customers’ first names. Solution Preview Summary There are different ways to process this cleaning up, as the special character is the first character of all customers’ first names, it’s easier to use Substring(Initial string value, character position used to begin substring) function to remove the first […]

  • Day 9 – Random discounts

    Challenge https://ampscript30.com/ampscript-challenge-day9/ To provide random discounts to each customer. Solution Preview Summary When writing data to a Data Extension, it’s a good practice to always capture the Subscriber Key or even the Send Job ID.

  • Day 8 – Different discounts for different email addresses

    Challenge https://ampscript30.com/ampscript-challenge-day8/ To offer different discounts for different types of email addresses. Solution Preview Summary IndexOf(variable to be assessed, character position to return) can be used to check if the variable contains certain characters. If the result is > 0, it means the variable contains those characters or else not. This way we can evaluate […]

  • Day 7 – Calculate Renewal Date

    Challenge https://ampscript30.com/ampscript-challenge-day7/ To calculate the renewal date from today’s date based on different payment plans. Solution Preview Summary For Now() function, if (1) is used, after an email is sent, it will preserve the send time instead of the current system time; if it’s for a triggered send, it will preserve the time when the […]

  • Day 6 – Calculate BMI

    Challenge https://ampscript30.com/ampscript-challenge-day6/ To display the calculated BMI for customers on individual emails. Solution Preview Summary FormatNumber(Value to receive the specified formatting, Valid format type value) function formats number values by rounding the numbers to fewer decimal places.

  • Day 5 – Offer different discounts based on dates

    Challenge https://ampscript30.com/ampscript-challenge-day5/ To offer different discounts depending on customers’ upcoming birthdays. Solution Preview Summary There are different ways to achieve the goal depending on how the dates are manipulated.

  • Day 4 – Display different messages depending on whether email addresses are correct

    Challenge https://ampscript30.com/ampscript-challenge-day4/ To display different messages on the email depending on whether the email addresses are correct. Solution Preview Summary Although this way works, it’s better to use IsEmailAddress(EmailAddress) function to evaluate if the email address is valid. If there are only two conditions, IIF(condition, value to return if condition is true, value to return if condition is […]

  • Day 3 – Provide different offers based on locations

    Challenge https://ampscript30.com/ampscript-challenge-day3/ To offer different discounts based on where customers locate. Solution Preview Summary IF/THEN statement allows the conditional execution of any content within the IF block depending on the logic expressions it contains. If there are only two conditions, IIF(condition, value to return if condition is true, value to return if condition is false) […]

  • Day 2 – Format the displayed date

    Challenge https://ampscript30.com/ampscript-challenge-day2/ To format the displayed date on an email. Solution Preview Summary Format(Variable to format, the intended format) formats the value according to the string (the intended format) you specify. Date format syntax – https://help.salesforce.com/s/articleView?id=sf.dato_data_mapping_date_formats.htm&type=5

  • Day 1 – Capitalised the initial letter

    Challenge https://ampscript30.com/ampscript-challenge-day1/ To display the customers’ first names with correct capitalisation. Solution Preview Summary ProperCase(string) function returns specified string with the initial letter of each word capitalized. V(string) function outputs the value of a variable.