Inactive users

Community Alums
Not applicable

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.

3 ACCEPTED SOLUTIONS

swathisarang98
Giga Sage
Giga Sage

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,

 

swathisarang98_0-1710410918198.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

 

View solution in original post

@Community Alums  if you want to get active users you have to put a reference qualifier like active is true 

swathisarang98_0-1710416542168.png

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

 

View solution in original post

Its_Azar
Tera Guru

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. 

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

HI @Community Alums ,

Sorry your question is incomplete !!

Please re-phrase and attach some screenshots.

 

 

swathisarang98
Giga Sage
Giga Sage

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,

 

swathisarang98_0-1710410918198.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

 

Community Alums
Not applicable

How to find active r inactive users in catalog item

 

@Community Alums  if you want to get active users you have to put a reference qualifier like active is true 

swathisarang98_0-1710416542168.png

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