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
12-02-2022 12:03 AM
Unfortunately no @Mitsua , i created a Business rule to check the opened_by user group memberships and i pass the g_scratchpad.hide_confidential_info variable to this Client script in order to hide the field. In Catalog UI policy i cannot check the opened_by user group memberships, from what i saw.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2022 02:24 AM
Hi @Fotios Kossyvas ,
Can you try adding this line and remove other code where you are setting the variable false.
g_form.setDisplay('varibles.dxc_info.more_info',false);
Regards,
Gagan k
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2022 03:26 AM
Thanks for the suggestion @Community Alums, i tried it but it doesn't work either. I opened a case at Servicenow Support to see if i'ts a bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2022 03:46 AM
Alright. That's little strange it's not working. Just to double check, hope you have ticked UI type as - All. Sometimes it doesn't work because of this.
Regards,
Gagan k
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 12:52 PM
Wondering if you ever conquered this- we're trying the same thing. Essentially- need to show a variable starting during a task that's 3rd in sequence. would love to trigger the 'displaying' of that variable with flow designer but my custom action with script is failing to alter the display setting with similar scripting as above.