We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Default Form Section Expansion on Load in Workplace

Berta
ServiceNow Employee

Is there a way to ensure that all sections of a form are expanded by default when it loads( workspace) , regardless of whether those sections were previously minimised on other records?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Berta 

this worked for me in onLoad client script, this works in workspace only

function onLoad() {
    //Type appropriate comment here, and begin script below
    g_aw.setSectionExpanded('impact', true);
    g_aw.setSectionExpanded('assignment', true);
    g_aw.setSectionExpanded('cause', true);
    g_aw.setSectionExpanded('resolution', true);
    g_aw.setSectionExpanded('related_records', true);
    g_aw.setSectionExpanded('incident', true); // main section
}

Output

auto expand section sow.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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Berta 

this worked for me in onLoad client script, this works in workspace only

function onLoad() {
    //Type appropriate comment here, and begin script below
    g_aw.setSectionExpanded('impact', true);
    g_aw.setSectionExpanded('assignment', true);
    g_aw.setSectionExpanded('cause', true);
    g_aw.setSectionExpanded('resolution', true);
    g_aw.setSectionExpanded('related_records', true);
    g_aw.setSectionExpanded('incident', true); // main section
}

Output

auto expand section sow.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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

pichikasrav
Tera Contributor

Used the same on my client script ,but it is not working for me in the workspace .Any help here please ?

pichikasrav_0-1777305191873.png

@Ankur Bawiskar