Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Form new section visibility

Merza Lyn
Giga Guru

I add a new section tab to our Change Request form.

 

MerzaLyn_2-1764040486067.png

 

How to make that section to be visible to specific location only?

Condition:

Change Area is "Application"

Type is Normal

Requested for or Opened by location: T1, T2,T3

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron

@Merza Lyn 

you will have to use UI policy for this with that condition

Then in Run Scripts Execute if True add this and do reverse in Execute if False

g_form.setSectionDisplay('system_security_analysis', true); // show section

Like this

AnkurBawiskar_0-1764042288513.png

 

If the logic is complex then you can use Display business rule and scratchpad + onLoad client script

Display BR: sets the scratchpad as true/false

onLoad client script: grabs the scratchpad value and shows/hides the section using the same above g_form method

💡 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

I tried this, but it did not worked.

I modify it to and it worked.

g_form.setSectionDisplay("system_securityanalysis", true);

 

View solution in original post

6 REPLIES 6

@Merza Lyn 

I believe I shared a working solution.

it's just that section name you had to pick properly and update in the script I had shared.

Please mark my response as correct as it helped you.

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

yashkamde
Mega Sage

Make a specific view excluding that section in system ui -> views and make that view visible to the specific location only in the script section of system ui -> view rules..

If you find this helpul please mark it has helpful...!