Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to show a form section to only specific group members?

sejalsarve
Mega Contributor
Hi All,
 
I have a requirement on the HR Workforce Admin table.
 
There is a form section/tab named "Out Counselling Details" (backend name: outcounseling_details). I need this section to be visible only for members of the following groups:
 
- SYNE-Out-Counselling Group
- SYNE-Out-Counselling Exception Group
 
For all other users, the section should remain hidden.
 
I tried using:
- Client Script
- Script Include 
 
However, the section is still not behaving as expected.
 
What is the recommended way to show/hide a form section for specific group members?
 
Any guidance or best practices would be appreciated.
 
Thanks.
4 REPLIES 4

Dinesh Chilaka
Mega Sage

@sejalsarve ,

You have kept some logs inside the Script include, do you able to see those logs?

Thanks,

Dinesh

 

Ankur Bawiskar
Tera Patron

@sejalsarve 

so what are your findings?

Did the log show correct details?

what came in alert as response from Ajax?

💡 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

sejalsarve
Mega Contributor

 Yes log show correct deatils.

 

@sejalsarve 

what came in alert i.e. the response from ajax?

Also if any field is mandatory in that form section it can't be marked as hidden

💡 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