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

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

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

@Merza Lyn 

Thank you for marking my response as helpful.

💡 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

I tried this, but it did not worked.

I modify it to and it worked.

g_form.setSectionDisplay("system_securityanalysis", true);

 

test