How to hide variables section or incident variable editor on the incident form?

dharanikumar
Giga Guru

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.

find_real_file.png

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.

find_real_file.png

Please suggest me how to achieve this. 

-Dharani

14 REPLIES 14

Harsh Vardhan
Giga Patron

adding one thread here. on which they have used on RITM but you can try to make some changes and make it happen on incident form..

 

please refer the below thread.

 

https://community.servicenow.com/community?id=community_question&sys_id=0c14cbe5dbd8dbc01dcaf3231f96...

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

 

You can hide the entire section simply using the code below in an onload client script

function onLoad() {  

 

var sections = g_form.getSections();  

 

sections[4].style.display = 'none';  //make sure you number the right section that has the variables

 

}

 

Please mark my answer correct/helpful if it helped you solve your issue.

-Anurag

-Anurag

Hi Anurag,

The above code is helping to hide the Sections like Notes, Related Records etc... But the Incident Variable Editor is above these sections. Please check the below screenshot.

find_real_file.png

 

-Dharani

have you checked the thread which i had provided?