How to hide variables section or incident variable editor on the incident form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 03:50 AM
Hi All,
I want to hide the Variables section / Incident Variable Editor on the incident form.
Steps to re-produce in our OOB instances:
1. User Self Service -> Click on Service Catalog.
2. Search for Create Incident and open it. Fill the required fields and submit the record.
3. Incident will be created and would be shown in self-service view. Change the view to default view. Then we can see the variables available in variables section / Incident variable editor. Please refer to the below screenshot.
Tried Steps:
1. Created a Catalog UI Policy and set this to target record level. It is hiding the variables but the section will available on the form. Something it is like empty variables section.
2. Created Catalog Client Script on the and set this target record level. The same is happening here it will hide the variables but the section will be available.
3. I thought if we the hide all the related variables which are available in the variables section / Incident Variable Editor. Then the variables section will be auto hided.
4. For some reasons the section will available there. Please check the below screenshot.
Please suggest me how to achieve this.
-Dharani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 05:11 AM
Its definitely not recommended but sometimes there is no other way. That is why initially i approached using section(put the variable editor in a different section) and hide the section as needed using oob functions.
But that is not working out here
so...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 05:12 AM
A cleaner code to achieve the same
var ve = $('variable_map').up('table');
ve.style.display='none';
Please mark my answer correct/helpful if it helped you solve your issue.
-Anurag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 04:14 AM
Not sure why the view is different in my case , i followed the same steps as suggested but am not able to see it on my form
If its not an RITM and if its a custom form then check whether the variable editor macro kind of thing has been added on to the form just remove it from the configure - > form layout or if the form has sections then you can hide the sections in the form as shown below
GlideForm - getSectionNames()
Returns all section names, whether visible or not.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array of strings | The section names. |
GlideForm - getSections()
Returns an array of the form's sections.
This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array of HTML elements | The form's sections. |
function onChange(control, oldValue, newValue, isLoading) { //this example was run on a form divided into sections (Change form) // and hid a section when the "state" field was changed var sections = g_form.getSections(); if (newValue == '2') { g_form.setSectionDisplay(sections[1], false); } else { g_form.setSectionDisplay(sections[1], true); } }
Hope that helps
Thanks
Siva
Mark this as correct if that really helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 10:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2021 03:44 AM
Hi Dharani
Did you find any acceptable solution for this? I need to hide variables section on Change form.
Mine is a Record Producer with many variables. Since all of them are mapped to the fields in change request I don't want Variables section visible anymore. Let me know if you found any script that helped you achieve this.
ThankYou,
Sumana