List Collector Show Group Members Only
Overview
Say a Catalog Item has a Reference variable pointing at the Group (sys_user_group) table, and a separate List Collector variable pointing at the User (sys_user) table. Whatever group is selected in the Reference variable, the List Collector should only offer that group’s members as choices.
This isn’t something a static reference qualifier can do, since the list of valid users depends on the group picked at runtime. Instead, use a script include as a dynamic reference qualifier on the List Collector field.
Script Include
Create a Script Include that takes a group’s sys_id and returns an encoded query of that group’s members:
| |
'sys_id=NULL' when no group is selected ensures the List Collector shows zero results instead of every user in the system.Configuring the List Collector
Navigate to the List Collector field on the Catalog Item’s variable set.
Set the Reference qualifier to call the script include, passing in the Reference variable’s name:
javascript: new global.CheckGroupMembership().getGroupMembersRefQual(current.variables.your_group_variable_name.toString());Replace
your_group_variable_namewith the actual name of your Group reference variable.
