show all the groups that user is member of

dev_K
Tera Contributor

Hello,

 

I have a catalog item with a field where user can select a group he belongs to.

 

dev_K_0-1727443929711.png

 

 

In the ESC it shows me the 'created' value but I would prefer the name.

 

dev_K_1-1727444063182.png

 

 

 

How this can be fixed?

3 REPLIES 3

Rajesh Chopade1
Mega Sage

hi @dev_K 

Ensure that the reference field in your catalog item is using the correct display field from the sys_user_group table.

 

Look for the dictionary entry for the field that you are interested in. If you don't see it immediately, you can search using the Name field (like "name").

Ensure that the Display checkbox is checked for the name field. This means it will be used as the display value for the reference field.

If you have custom fields that you want to use as display values, you can also ensure that their Display checkbox is checked.

 

i hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

rajesh

Sai25
Giga Guru

Hi,

Reference should be group table.

 

javascript:getGroups(current.variables.your_field_name);//Reference Qualifier
create a script include and call in the reference qualifier.

function getGroups(grp_id) {

        var answer = [];

        var mem = new GlideRecord('sys_user_grmember');
        mem.addQuery('user', grp_id);
        mem.query();

        while (mem.next()) {

                 answer.push(mem.getValue("group"));
       
        }
    return "sys_idIN" + answer.join();

Sandeep Rajput
Tera Patron
Tera Patron

@dev_K Please use the following steps to fix this issue.

Configure the Group Member table as follows.

 

Screenshot 2024-09-27 at 7.44.59 PM.png

2. Set the Display field to true for Group field.

Screenshot 2024-09-27 at 7.47.25 PM.png

Refresh the page and you should be able to see the group name in the group field.

 

Hope this helps.