Expand my Community achievements bar.

Join Adobe Journey Optimizer product experts for a live Ask Me Anything on October 15th at 8 AM PT about Expanding Your Mobile Reach with RCS & WhatsApp in AJO!
SOLVED

Equivalent of Mask function to be used in Custom Action

Avatar

Level 2
Level 2

Hi there,

Can you let me know what expression I can use to show only the last 4 digits of accountnumber in one of the fields in Custom Action (under Actions in Journey Builder)?

I tried this but throwing me errors saying i cannot use the character '-' like this because it is a keyword of the language. I tried adding double and single quotes to wrap -4 but no luck either.

 

substr(toString(#{headfield.at(0).accountNumber}), (length(toString(#{headfieldat(0).accountNumber})) - 4), 4)

 

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

You can use the following expression. Feel free to replace 123456789 with the accountNumber attribute path

substr(toString(123456789), (length(toString(123456789)))-4)

 

View solution in original post

4 Replies

Avatar

Correct answer by
Employee Advisor

You can use the following expression. Feel free to replace 123456789 with the accountNumber attribute path

substr(toString(123456789), (length(toString(123456789)))-4)

 

Avatar

Level 2
Level 2

Hi @Mohan_Dugganab, I managed to replace 123456789 with the attribute fieldname and no errors. Thanks heaps!

 

For email, achieving the same objective, I used the same expression and no validation errors which I thought was weird as i didn't use {%=; would you mind take a look and let me know it looks right to you?

 

The copy" ending in substr(toString({{profile._123456789}}), (length(toString({{profile._123456789}})))-4)"
 
Thanks again!

Avatar

Employee Advisor

In emails, you can use an expression mentioned in this post as the syntax is different https://experienceleaguecommunities.adobe.com/t5/journey-optimizer-questions/how-to-get-the-last-4-d... 

Avatar

Level 2
Level 2

Thanks @Mohan_Dugganab!