g_form.setDisplay not working for a RITM variable on the backend form using a Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:48 AM
Hi, i am trying to hide a RITM variable on the Servicenow backend form using a Client Script but i cannot find a way to actually do it.
I have these variables showing on the form, the two of them are surrounded by a red box here are part of a variable set called dxc_info
The variable i am trying to hide is the second one, called more_info
The only thing that works is hiding the whole variable set, not just the more_info variable. Of course, i am showing here what works and what not, i am not really hiding the variable set and then trying to hide the single variable 😏
i tried the g_form setVisible() method too but it doesn't work too.
Can anyone help me please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:54 AM
Hi,
Please try only below:
g_form.setDisplay('more_info',false);
Comment or remove the line:
g_form.setDisplay('variables.more_info',false);
If this line throws error next line will not execute.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 01:00 AM
Hi Anil Lande, i have already tried that, it just don't work. Either of these ways don't work.
I have inserted them on the script just to show what i had tried.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 01:13 AM
Hello @Fotios Kossyvas ,
Can you try creating a Catalog UI policy and check the check box "Applies to RITM" and make the catalog UI policy action for that variable visible false.
is this feasible or you have to check few conditions before making it visible false?
Hope this helps
Mark my answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 05:12 AM
Hi @Mohith Devatte , i have to check conditions before making it visible false.
In fact, i am using a business rule where i code these conditions and set a scratchpad variable. Then on the Client script i check the value of this variable so i can hide the field.
I tried to see if i can use a Catalog UI policy to do it but i miss these conditions this way.