Get Form Section Name

kemmy1
Tera Guru

I have a form section (tab) called Archive Problem Information.  I'm trying to show/hide it with an onLoad client script and this is not working:

function onLoad() {

    if(g_form.getValue('u_obim_problem') != ''){
        g_form.setSectionDisplay('archive_problem_information', true);    
        
    }
}

 

Where in the world can I find the backend name of the form section?  I've looked everywhere.  The sys_ui_section table does not give me the information.

 

Thanks!

Lisa

1 ACCEPTED SOLUTION

Rajesh Kannan G
ServiceNow Employee
ServiceNow Employee
sectionNameStringThe section name is lower case with an underscore replacing the first space in the name, and with the remaining spaces being removed, for example "Section Four is Here" becomes "section_fourishere". Other non-alphanumeric characters, such as ampersand (&), are removed. Section names can be found by using the getSectionNames() method.

 

Refer our documentation for more details.

Regards,

Rajesh

View solution in original post

5 REPLIES 5

Rajesh Kannan G
ServiceNow Employee
ServiceNow Employee
sectionNameStringThe section name is lower case with an underscore replacing the first space in the name, and with the remaining spaces being removed, for example "Section Four is Here" becomes "section_fourishere". Other non-alphanumeric characters, such as ampersand (&), are removed. Section names can be found by using the getSectionNames() method.

 

Refer our documentation for more details.

Regards,

Rajesh

Thanks Rajesh!  I always have struggled with this and now I know!

sayali udgave
Kilo Guru

Hi,

Try this one. It works for me

var sections = g_form.getSections();
sections[1].style.display = 'none';
 
 
Thanks
Sayali

vkachineni
Kilo Sage
Kilo Sage

var sections = g_form.getSectionNames();
console.log(sections.toString());

should give you the names

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022