Hide a label type variable in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 02:50 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 03:26 AM
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);
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 06:34 AM - edited 05-26-2023 06:41 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 07:27 AM - edited 05-26-2023 07:29 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 06:40 AM
any browser console error?
share your client script screenshot
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader