I want to mask the account number field with '*' and want to show only the last 4 digits.

ex. Acoount number - 12456665 Masked number - ****6665

The length of account number is not fixed. is it possible using formula field?


You can do it like this: LPAD(RIGHT(AccountNumber, 4), LEN(AccountNumber), '*')

RIGHT takes the last 4 characters from the account number

LPAD adds (AcocuntNumber character length - 4) '*' characters on the left of the string


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.