my query is, Populate the list of group members in a list collector as per the group selected in a reference field above.

poornima srivas
Kilo Contributor

when i select any group then only particular group members is visible in list collector.

8 REPLIES 8

Filipe Cruz
Kilo Sage
Kilo Sage

Hello poornima,

Set a reference qualifier for that list collector.

That reference qualifier needs to be a call to a script include like this:

javascript:"sys_idIN" + new Utils().getMembersOfGroup(current.variables.group);

where "current.variables.group" is the way to call the variable that contains the group (update the name "group" according to the right name of your variable).

Then, create a Script include called "Utils" with a method called "getMembersOfGroup" that will receive a parameter called "assignment_group". That method should have a code like:

getMembersOfGroup: function(assignment_group) {
    var result = [];
    var gr = new GlideRecord("sys_user_grmember");
    gr.addQuery("assignment_group", assignment_group);
    gr.query();
    while (gr.next()) {
        result.push(gr.getValue("user"));
    }

    return result.join(",");

}


With this, you will be able to filter your list collector based on the selection of the assignment group.

Hope this helps!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz



Thanks

Aman Kumar S
Kilo Patron

This one should be simple.

  1. Configure your list dictionary
  2. Select Advanced view
  3. Go to Dependent value section
  4. Select your Group field

Do let me know, if this helps your case 🙂

Best Regards
Aman Kumar

@poornima srivastava 

Did you try this?

Best Regards
Aman Kumar