How to display last four digit of password field

Need to display the password field for masking and now requirement got changed and need to display the value of last 4 digit( only password field)

Previously we are displaying like this ex: ••••••••••••

now business requirement is •••••••••9884

Marked the text field as password Property name Account Number and more important field needs Editable (So provided as password field) . Not to display with XXX and need dot as per business

Please help me out

***Edited by Moderator Marissa to update platform capability tags****


Keep up to date on this post and subscribe to comments

November 29, 2018 - 3:00am

I don't think it is achievable using OOTB. You need to customize. Please refer to the below article.

November 29, 2018 - 5:03am
Response to Rachit_Agarwal

Thanks for the response..I went through your link. Can you brief me how to achieve this in pega?

November 30, 2018 - 5:57am

Hi All,

Any suggestions/solutions to implement this requirement.???


December 3, 2018 - 9:21am
Response to Mohan_Poojary

Try This...


@(Pega-RULES:String).substring(YourProperty,((@(Pega-RULES:String).length(.YourProperty) ) - 4), @(Pega-RULES:String).length(.YourProperty))

It will display last four digits.



December 4, 2018 - 12:36am
Response to BhaskarBPM

Hi Bhaskar thanks for the response.

My requirement is need to like this   •••••••••9884. But your code will return only last 4 digit with obfuscated(masked) for password field.

While entering data to the text field it should mask except last 4 digit.

Please let me know if any suggestions

December 4, 2018 - 2:16am
Response to Mohan_Poojary

Try This MOhan..

Add * depending on your lenght expect last 4 digits.

"**********" + @(Pega-RULES:String).substring(YourProperty,((@(Pega-RULES:String).length(.YourProperty) ) - 4), @(Pega-RULES:String).length(.YourProperty))

December 4, 2018 - 8:22am
Response to BhaskarBPM

Hi Bhaskar,

That will work. but my requirement here is:  text field is editable(Account Number). while entering text it should mask. We have to search this specific account number to get the list

Account Number: Text field (********9887) while entering it should mask except last 4

search button: will pull up list of result for this specific acct no

Repeating grid here to display all search details

December 7, 2018 - 1:25am

Any other suggestions???