How to filter a catalog item reference variable based on the logged-in user’s segment description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
In a catalog item reference variable that uses the cmdb_ci_business_app table as the reference, how can I configure it so that, when the logged-in user’s segment description field in the sys_user table is “AAA”, only records whose Owning organization field in the cmdb_ci_business_app table is “AAA” are displayed as selectable options?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
32m ago
Hi @Ryota ,
you can simply right the advanced reference qualifier as below,
javascript: 'owning_organization='+gs.getUser().getRecord().getValue('segment_description');Replace with your field names in the above reference qualifier.
If my response helps, please mark my response as helpful and accept the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
26m ago
something like this but please enhance, this should work in both scope app + global scope
Note: I assume both the fields 1 that is on sys_user and other on cmdb_ci_business_app are of same type
javascript:
var query = '';
var val = '';
var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", gs.getUserID());
gr.query();
if (gr.next()) {
val = gr.owningFieldName.toString();
}
query = 'owning_organization=' + val;
query;
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
