web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to camouflage PII ...
Power Pages
Answered

How to camouflage PII in Portal PowerApps?

(0) ShareShare
ReportReport
Posted on by 559

I am collecting Social Security in a Portal PowerApp. I would like to turn 123-45-6789 into say 123-4#_#### as soon as user keys in the value. How do I achieve it? Is there a REGEX or Java Script to achieve this? IF so, can you please show me this?

Thank you.

Categories:
  • D365-Developer Profile Picture
    Microsoft Employee on at
  • SueA Profile Picture
    559 on at

    Hi:

    Thank you for your response. But the JavaScript you provided did not work in the "Form Options" of Portal Management's Advanced Form nor CSS worked in the liquid Code Editor on the Portal to camouflage the Social Security. Can you please tell me where does this script go in the Portal Management or on the Portal?

     

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    hi @SueA the approach above would be creating an additional input control and manipulating via JS

     

    there are other similar codes available online as well: https://stackoverflow.com/questions/40513950/javascript-input-text-masking-without-plugin

     

    can you give more details of your requirement? users would still be able to inspect the page and check the real value.. also what's the business value on this requirement? 

  • SueA Profile Picture
    559 on at

    Thank you, Oliver for your reply.

    Here is the Requirement:

    “Each digit is only visible as it’s typed and then ideally is hidden as a number sign (#) after a few seconds (e.g.: 123-4#-####) or optionally when clicked next button at the bottom of that page and will show the masked number if clicked “Previous” button at the bottom of the next page of the form giving submitter a sense of security when submitting important PII such as SSN in an online form. However, the actual and complete value goes directly to secure Dataverse and email notification when the form is submitted.”

     

    Is there a Java script or another way to achieve this? Can you explain in detail and step by step as I am novice, please?

    My column/field name is:       pde_socialsecuritynumber

     

  • Verified answer
    oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    sorry about the delay, I think the easiest way here would be turning your input element into a Password type:

    $("#pde_socialsecuritynumber").attr("type","password")

    this is a quick win, but they wouldn't see the value when typing, it would always be hidden

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 29

#3
11manish Profile Picture

11manish 23 Super User 2026 Season 2

Last 30 days Overall leaderboard