- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 11:41 AM
Hi All,
I need to hide few fields on a form based on a condition and also for itil role. I am having 20+ fields on form and need to hide 3 fields.
Those 3 fields should not appear as per reporting purpose.
How can I proceed with this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 09:37 PM
Hi,
you can use field level READ ACLs on those fields and hide those on list view
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
‎03-24-2022 11:48 AM
Hi Renu,
You need to create 3 read ACL on the mentioned field and put the relevant condition and provide ITIL role in the role section.
Regards,
Deepankar Mathur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 11:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 11:22 PM
Hi Renu,
You can use the onLoad client script
var isITIL= g_user.hasRole('itil');
if(your_condition && isITIL){
g_form.setMandatory('field1',false); //if your field is mandatory
g_form.setDisplay('field1',false);
g_form.setMandatory('field2',false); //if your field is mandatory
g_form.setDisplay('field2',false);
g_form.setMandatory('field3',false); //if your field is mandatory
g_form.setDisplay('field3',false);
}
else{
g_form.setMandatory('field1',true); //if your field is mandatory
g_form.setDisplay('field1',true);
g_form.setMandatory('field2',true); //if your field is mandatory
g_form.setDisplay('field2',true);
g_form.setMandatory('field3',true); //if your field is mandatory
g_form.setDisplay('field3',true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 11:27 PM
Can you mark my response as correct to your earlier question?
You have marked my response as helpful for it.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader