- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 08:51 AM
Hey,
I have a requested by field on the form (refferenced to sys_user table), which based on it's default value detect user (javascript:gs.getUserID()) - that works fine.
Now I would like to create another field
'Does user has a 'itil' role?', how on the Catalog Item/Record producer can query for this and push the outcome to that new field?
TIA
Matt
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 03:56 AM
try to use onLoad catalog client script
Ensure you perform testing by logging in and not impersonating
function onLoad() {
if (g_user.hasRole('itil'))
g_form.setValue('variable', 'Yes');
else
g_form.setValue('variable', 'No');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 04:36 AM
so it is from currently logged, however I have variable 'created_by' that detects user based on default value - javascript:gs.getUserID()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 10:49 PM