Expand my Community achievements bar.

SOLVED

How can i transform a field into lowercase?

Avatar

Level 2

Hi! the field @FirstName of my database is formated all in Uppercase (example: DAVID, JOHN,MARIE...) But i would like to personalise my  email delivery so i can use correctly the names (David, John, Marie).

 

How can i do to preserve the first letter as uppercase but transform the others to lowercase?

 

Thank you!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Javi_Landa ,

You can use the below in built function to convert the @FirstName of the Database Value to Proper Case(First Letter Upper Case and other letters in Lower Case), by below:

 

Inside the query activity pull @FirstName field, in the Additional Data section, configure the field in this way:

 

Smart(@firstName)

LakshmiPravallika_1-1689676253826.png

 

LakshmiPravallika_0-1689676225950.png

 

LakshmiPravallika_2-1689676297898.png

 

after doing this , try pulling the configured Variable inside the delivery activity as shown below:

LakshmiPravallika_3-1689676530130.png

 

Regards,

Pravallika.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @Javi_Landa ,

You can use the below in built function to convert the @FirstName of the Database Value to Proper Case(First Letter Upper Case and other letters in Lower Case), by below:

 

Inside the query activity pull @FirstName field, in the Additional Data section, configure the field in this way:

 

Smart(@firstName)

LakshmiPravallika_1-1689676253826.png

 

LakshmiPravallika_0-1689676225950.png

 

LakshmiPravallika_2-1689676297898.png

 

after doing this , try pulling the configured Variable inside the delivery activity as shown below:

LakshmiPravallika_3-1689676530130.png

 

Regards,

Pravallika.

Avatar

Level 6

Hi @Javi_Landa ,

I just tested below function and it is working. You can use the same and it will convert into your use case. Just do the same in Enrichment Activity.

 

aggabhi_0-1689676893135.png

 

Regards

Abhishek

 

Avatar

Community Advisor

Hi @Javi_Landa,

alternatively, if you do not wish to use the enrichment and the "smart()" function - you can simply do the following in your email template:

<%= recipient.firstName.substring(0,1).toUpperCase()+recipient.firstName.substring(1,100).toLowerCase() %>

I am assuming that the field to be used for personalization is "firstName" in the recipient schema, and that the max length of the field is 100 characters. You can adjust these accordingly as per your data model and personalization need.

 

Regards,

Ishan