Hide a label type variable in Service Portal

ceraulo
Mega Guru

Hello!

 

I have a variable which is of type label. I want to hide this label in the Service Portal. I've tried using the script below but it does not work.

g_form.setDisplay('label_name', false);

Please help!

Thank you.

 

 

4 REPLIES 4

Voona Rohila
Kilo Patron
Kilo Patron

Hi @ceraulo 

Is your client script UI Type set to ALL?

You should provide back-end name of the variable.

g_form.setDisplay('backend_name',false);

VoonaRohila_0-1685096764664.png

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hi @Voona Rohila 

I selected Mobile/Service Portal because I only want it hidden in the Service Portal. It should be visible in the backend.

I also used your sampke code but it doesn't work.

Make sure you are using correct field name, Also share the client script logic.

I just tried and it's working.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Ankur Bawiskar
Tera Patron
Tera Patron

@ceraulo 

any browser console error?

share your client script screenshot

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