- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 04:10 AM
Hi guys,
I have created a new tab in our change request form called Lessons Learnt.
Now this tab should only be visible to change_manager role.
I have created read ACLs for each of the fields in the lessons learnt tab, so only change management can see them.
However, I cannot seem to hide the tab itself, see below.
please also note, I have also a UI policy which makes the lessons learnt tab only visible when the closure code is unsuccessful or successful with issues.
So although this policy hides the form, but i also need it to stay hidden if the user does not have change_manager role, even if the ui policy is triggered.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 04:16 AM
Hi,
update the UI policy script as this
Execute if true:
function onCondition(){
if(g_user.hasRole('change_manager')){
g_form.setSectionDisplay('lessons_learnt', true);
}
else{
g_form.setSectionDisplay('lessons_learnt', false);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 04:16 AM
Hi,
update the UI policy script as this
Execute if true:
function onCondition(){
if(g_user.hasRole('change_manager')){
g_form.setSectionDisplay('lessons_learnt', true);
}
else{
g_form.setSectionDisplay('lessons_learnt', false);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 04:17 AM
Hello,
The sample script is below
function onCondition() {
if (g_user.hasRole('change_manager')) { //change the name of the role accordingly
g_form.setSectionDisplay('lessons_learnt', true);
}
else {
g_form.setSectionDisplay('lessons_learnt', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 04:22 AM
Your script should work, it should remove the tab and all the fields within it.
Check this out
Show/Hide Form Sections with Multiple Spaces In the Name
-Anurag