Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

1 REPLY 1

Ankur Bawiskar
Tera Patron
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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader