How to include a Phone mask on a Catalog Variable on Service Portal

marcelo_moreli
Mega Guru

I have a variable "Phone" with a mask like "(000) 00000-0000".

It works perfectly on the Fulfiller screen, but now that we are migrating to Service Portal, I've noticed that you cannot use jQuery or DOM on Client Scripts.

Is it possible to put a phone mask on a variable so that it works on the Service Portal?

Thanks,

1 ACCEPTED SOLUTION

marcelo_moreli
Mega Guru

Answering my own question from 2y ago: In order to use jQuery from client scripts on the service portal, you should use this.$ instead of $

 

View solution in original post

7 REPLIES 7

venkatiyer1
Giga Guru

Hi Marcelo,



Did you try using the Variable type   - Masked (In variable form) while declaring the variable? Because on an out of the box item in Service Portal the masked variable is converting the text to masked dots.


Yes, I have tried that, but unfortunately that "Masked" type is only for passwords, not able to apply a specific mask (Phone).


Hi Marcelo,



This is a long shot but may be a good try as I am yet to try it. Just a suggestion as i haven't yet tried it. We can change the jquery plugin into a directive using a link like the one given below:-



Converting jQuery plugin to AngularJS Directive - Stack Overflow



and then apply the mask on to the field on the service portal front.


Unfortunately we cannot use "angular" directives as well on client scripts (only on widgets)