We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to hide sections using client script but the section's name are not in English

Alon Grod
Tera Expert

Hi,

Im trying to hide sections using onLoad client script using g_form.setSectionDisplay but the problem is that the section's name are not in English. When I do alert(g_form.getSectionNames()) the system recognize the name of the sections as '_', and I have few of thems. What can I do?

 

This is the Alert result:

AlonGrod_0-1765796202882.png

 

10 REPLIES 10

Ankur Bawiskar
Tera Patron

@Alon Grod 

try this and see if this works

// pass section name and then use

getMessage("work_ordertask", function(msg) {
    g_form.setSectionDisplay(msg, false);
});

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar still not working

@Ankur Bawiskar the problem is that because i have two sections with non English label, the system recognize both of them as '_'.

So basically i have two sections with the name '_'.

@Alon Grod 

why you have section with name as _ and don't have any english word for that?

doesn't look like a valid business requirement

section should have some name to it

how it looks on form -> share screenshots

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader