0
g_form.getSectionNames()

Output:
(5) ['notes', 'related_records', 'closure_information', 'major_incident', 'post_incidentreport']0: "notes"1: "related_records"2: "closure_information"3: "major_incident"4: "post_incidentreport"length: 5[[Prototype]]: Array(0)

g_form.setSectionDisplay("major_incident",false);

Output:

How to hide sections in ServiceNow?
Working Code Asked question July 6, 2023