1

I want to fetch date variable on a email in marketing cloud from a data extension that contains personalized dates. Also, when I preview the email, the date is displayed in the US format. I am looking to have the date displayed as dd mm yyyy (i.e in email the date should be 01 January 2018), how can I do this?

2 Answers 2

2

You can use date formatting function here.

%%[
VAR @date, @email
SET @email = EmailAddress /*This is the column name for email address that you have used in your DE*/
SET @date = Lookup('Data Extension name here','Date column name here that you have used in your Data Extension','Email Address column name here that you have used in your Data Extension',@email) /*To populate date value from your DE for the user to whom email will be sent*/
]%%

%%=FormatDate("@date", "DD MMMM YYYY")=%%

Please refer to this link for Date formatting function:

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/dateTimeFormatting.htm

Please refer to this link for Lookup function:

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/lookup.htm

1
  • Thank you Krati i will look up the links you gave me and try your solution.
    – Merlin
    Commented Nov 19, 2018 at 9:02
1

The date formatting function you provided is not returning any value when I go to preview my email send.

The below was used:

    %%[
    VAR @date, @email
    SET @email = Email (Email is the column name for email address in my DE)
    SET @date = Lookup('DE Name','Date column name','Email',@email) 
    ]%%

%%=FormatDate("@date", "DD MMMM YYYY")=%%

?

2
  • did you replace Email and Date column name with the correct attributes inside of your Data Extension? It sounds like your lookup is returning a null result. For instance, you could replace Email with AttributeValue("emailaddr") using the SFMC personalization string that pulls the associated sendable email address with that send. Commented Nov 19, 2018 at 13:50
  • Hi Yes I did, Email is "Email" in my data extension and date column was replaced with the attribute value using the personalisation string. I ended up uploading file in CRM as a text file, sync it to MC and using the personalisation in profile attribute as a workaround.
    – Merlin
    Commented Nov 26, 2018 at 4:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .