workspace form section

kack l
Tera Expert

Hello everyone, do you know how to hide certain sections in Workplace when a specific condition on the form is met?
For example, if the login date is after today, I want to hide or collapse the section named "User Information".

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@kack l 

you can show/hide the section using this in client script or UI policy script

g_form.setSectionDisplay('section_name', false);

// section name is convert everything in lower case and use _ if space is there

Example:

g_form.setSectionDisplay('resolution_information', false);

AnkurBawiskar_0-1747208119830.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

J Siva
Tera Sage

@kack l Go to form section under System UI

JSiva_0-1747208329299.png

 

View solution in original post

6 REPLIES 6

J Siva
Tera Sage

Hi @kack l 

You need to create a client script for the specific workspace view to meet your requirement.

  1. Identify the view linked to your workspace.
  2. Create the client script with the Global checkbox unchecked, allowing you to specify the workspace view name.

JSiva_0-1747207100444.png

Regards,
Siva

Thank you for your answer. How can I get the physical name of the section?

Ankur Bawiskar
Tera Patron
Tera Patron

@kack l 

you can show/hide the section using this in client script or UI policy script

g_form.setSectionDisplay('section_name', false);

// section name is convert everything in lower case and use _ if space is there

Example:

g_form.setSectionDisplay('resolution_information', false);

AnkurBawiskar_0-1747208119830.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

section

section.png

client script’

スクリーンショット 2025-05-14 165819.png

 

I don't know why. No response。