Masking field value

darshan-pra
Tera Expert

on form where active field set to true then firstname and lastname need to be get masked how to do the same ... which should be work in workspace as well as in native UI 

12 REPLIES 12

Ankur Bawiskar
Tera Patron

@darshan-pra 

but why?

you can use field level READ ACLs on those 2 fields and handle this if you don't want the fields to be seen on Form + List

Something like this, also add proper role

AnkurBawiskar_0-1768198199495.png

 

šŸ’” If my response helped, please mark it as correct āœ… and close the thread šŸ”’ā€” this helps future readers find the solution faster! šŸ™

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

There is no role provided for requirement

@darshan-pra 

you can use snc_internal role which every internal user has

šŸ’” If my response helped, please mark it as correct āœ… and close the thread šŸ”’ā€” this helps future readers find the solution faster! šŸ™

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@darshan-pra 

Hope you are doing good.

Did my reply answer your question?

šŸ’” If my response helped, please mark it as correct āœ… and close the thread šŸ”’ā€” this helps future readers find the solution faster! šŸ™

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Prathmeshda
Giga Guru

Hello @darshan-pra 

Enable Masking on the Fields

  1. Navigate to System Definition > Dictionary

  2. Open the firstname field

  3. Set Attributes:

     
    masked=true
  4. Repeat for lastname

This enables masking capability for the fields.

Create Read ACL with Condition (Active = true)
Create a Read ACL for:

  • Table: your table (e.g., sys_user or custom table)

  • Field: firstname

  • Operation: read
    Scripted ACL condition:

     
    answer = !current.active;

Meaning:

  • When active = true → read access denied → field is masked

  • When active = false → read access allowed → value visible
    Repeat the same ACL for lastname.

This approach works in both Native UI and Workspace.

If this response proves useful, please mark it as Accept as Solution and Helpful. Doing so benefits both the community and me. šŸ‘šŸ™‚