- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 01:36 AM
I have around 597 catalogue items. How to check for the look up field which the data is pulling from "sys_user" table, (where user is active. I have to find the fields which are pulling the inactive users in the look up fields.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 03:09 AM
Hi @Community Alums ,
You can navigate to item_option_new.LIST table where all catalog item variables are stored in that from personalize bring the reference field and in filter you can add something like Type is reference and Reference is sys_user table you will get all the field which are retrieving data from user table but then you have to go through each to check which one is getting inactive users,
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 04:43 AM
@Community Alums if you want to get active users you have to put a reference qualifier like active is true
and it depends like if no filter is added and no advance filter that means it is pulling all the record data which might be active or inactive
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 08:13 AM
Hey there @Community Alums
Thats a good question and guess you can use a script use a GlideRecord query to search for catalog items where these lookup fields are populated with inactive users.
Write a server-side script a BR or a SI to iterate through each catalog item and check the value of the lookup field. You'll need to compare the user's active status from the sys_user table.
Then you can generate the report
var catalogItemGR = new GlideRecord('sc_cat_item');
catalogItemGR.query();
while (catalogItemGR.next()) {
var userField = catalogItemGR.getValue('user_lookup_field'); // Replace 'user_lookup_field' with the actual field name
if (userField) {
var userGR = new GlideRecord('sys_user');
if (userGR.get(userField)) {
if (!userGR.active) {
gs.info('Catalog Item: ' + catalogItemGR.getDisplayValue() + ' - User: ' + userGR.name + ' is inactive');
}
}
}
}
If this helps kindly accept the response thanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 08:13 AM
Hey there @Community Alums
Thats a good question and guess you can use a script use a GlideRecord query to search for catalog items where these lookup fields are populated with inactive users.
Write a server-side script a BR or a SI to iterate through each catalog item and check the value of the lookup field. You'll need to compare the user's active status from the sys_user table.
Then you can generate the report
var catalogItemGR = new GlideRecord('sc_cat_item');
catalogItemGR.query();
while (catalogItemGR.next()) {
var userField = catalogItemGR.getValue('user_lookup_field'); // Replace 'user_lookup_field' with the actual field name
if (userField) {
var userGR = new GlideRecord('sys_user');
if (userGR.get(userField)) {
if (!userGR.active) {
gs.info('Catalog Item: ' + catalogItemGR.getDisplayValue() + ' - User: ' + userGR.name + ' is inactive');
}
}
}
}
If this helps kindly accept the response thanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 06:00 AM
Would the above suggestion impact performance? And does said GlideRecord query have to be added to each type of record or table, if you wanted to use an inactive user check on Incident, Change and all other records?