Equivalent of Mask function to be used in Custom Action | Community
Skip to main content
Level 2
May 22, 2025
Solved

Equivalent of Mask function to be used in Custom Action

  • May 22, 2025
  • 1 reply
  • 455 views

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!

Best answer by Mohan_Dugganab

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

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

 

1 reply

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
May 22, 2025

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

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

 

AK5Author
Level 2
May 23, 2025

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!
Mohan_Dugganab
Adobe Employee
Adobe Employee
May 23, 2025