String Manipulation only for display.

0
Hi All, The requirement is to show only the last 4 digits of the SSN. how I can meet this requirement in mendix(7.23.6). The value of SSN should not get change into the DataBase , only the display should be like XXX-XX-1234 instead of full SSN.  
asked
5 answers
2

Hi,

i think you could try to solve this with string functions in a microflow

Link

Below an image of a microflow that should help you on your way

answered
1

Try AppStore app ‘Formatstring’: https://appstore.home.mendix.com/link/app/264/ Might get you there, although I do not know if it can hide pieces of a value.

answered
1

Hi, you can try the following scenario. It’s my guess:

Create the java action, refer the following code:

public class Sample{
public static void main(String[] args) {
String SSNNumber = "1234567890";     
String LastFourDigitsNum = "";     

if (SSNNumber .length() > 4) 
{
    LastFourDigitsNum = SSNNumber .substring(SSNNumber .length() - 4);

else
{
    LastFourDigitsNum = SSNNumber;
}
System.out.println(LastFourDigitsNum);
    }
}

 

answered
1

You could create a 2nd attribute called “DisplaySSN” which masks the actual SSN in a before commit microflow, using one of the methods already mentioned. This way, you could set entity access rules which prevent users that do not have the required user roles to access the actual SSN field, and only allow read access to your partially masked field.

answered
1

Replacing the characters with xxxxxx isn't encryption. If you want the field to be editable (i hope only by some users) you can contrain this with entity access. Replacing the characters with xxxx client side will not be secure because the data will be readable. 

You will need a DisplaySSN to view to users you only can see the last part of the number. Make sure this is filled everytime the number changes. THis can be done in the microflow at the moment you change the ssn. Or in a before commit. 

Atribute ssn is readable/writebale by the user who can change the attribute. Attribute ssnDisplay is visible for all other users (and make sure they dont have rights for attribute ssn. 

answered