Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Customize & Extend
Unanswered

Masking SSN field with custom code but is being save with the actual value of the mask

(0) ShareShare
ReportReport
Posted on by 67

Dear community experts,

 

I have written a JS code to mask a SSN value in the DB that is working perfect at the power pages (portal) level, but the issue I have is that when I go to check the actual value in Dataverse it seems that is being saved with the XXX of the masking configured in the code and not the actual value entered, below the code, appreciated in advance any suggestion on how to fix this:

 

$(document).ready(function () {
 SnnpMask();
});
SnnpMask = function()
{
 $("#lts_patientsocialsecurity").mask("999-99-9999", { placeholder: "i.e.: xxx-xx-xxxx" });
 var temp;
 var regxa = /^(\d{3}-?\d{2}-?\d{4})$/;
 $("#lts_patientsocialsecurity").focusin(function () {
 $('#lts_patientsocialsecurity').val(temp);
 });
 $("#lts_patientsocialsecurity").on('blur', function () {
 temp = $("#lts_patientsocialsecurity").val();
 if (regxa.test($("#lts_patientsocialsecurity").val())) {
 $("#lts_patientsocialsecurity").val("XXX-XX" + temp.slice(6));
 }
 });
};

 

Dataverse view

josegdiazv_1-1686597575578.png

Thank you,

 

Jose  G Diaz

  • Jose Gregorio Diaz Profile Picture
    67 on at
    Re: Masking SSN field with custom code but is being save with the actual value of the mask

    Hi Saud,

     

    Thank you for the reply but not sure how would I do that? could you please send me a screenshot? right now I have it configured in the corresponding specific step the multistep form, see the picture below:

     

    josegdiazv_0-1686762403181.png

     

    Thank you,

     

    Jose G Diaz

     

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at
    Re: Masking SSN field with custom code but is being save with the actual value of the mask

    Hi @josegdiazv ,

     

    I would suggest masking your column on form submission. When you set some value on Portal before record saved the same value is pushed in the Dataverse.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43

Featured topics