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 i dont have a section name as '_'. 

I have a section name in Hebrew but the system convert it to '_' because its non English letters

@Alon Grod 

always give section name in english and system will store the translation value automatically

then use the script I shared and it will work for both English and other language

-> rename that section with English word

AnkurBawiskar_0-1765797381701.png

 

💡 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
Tera Patron

@Alon Grod 

Script I shared is working fine when you have proper section name and the script hides it when language is switched

hide section with english and other language.gif

💡 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 yes its working when the section's name is in English but my section name needs to be display to the user in a different language than English because they are not using the system in English. So this solution is not helpful

@Ankur Bawiskar my section's name is a customize name and the system does not has an automatic translation for that