Is it possible to use a user group as a reference qualifier?

C_dric Chen
Tera Contributor

Greetings, everyone.

Long story shot: I have a few "Reference" fields, of which the reference is the "user" table, and I'm wondering if it would be possible to use user groups (not departments or companies) as the reference qualifiers of these "Reference" fields.

Any help would be greatly appreciated!

6 REPLIES 6

Muhammad Khan
Mega Sage

You can utilize script include to either return the sys_id or complete filter to filter out records in reference qualifier.

Mohith Devatte
Tera Sage
Tera Sage
Hello , you can use but can you tell the exact requirement?

Hello.

Here's an example for the exact requirement:

  • Field label: "Administrative Assistant"
  • Reference table: "user"
  • User group: "Administrative Assistant"
  • Requirement: I must be only allowed to select one of the members of the "Administrative Assistant" user group for the "Administrative Assistant" field.

Did that make sense?

You can call a script include for this in the advanced reference qualifier like below

 

javascript:new yourscriptinclude_name().your function_name()

 

Script include: 

Must be non client callable script include 

 

Your_function_name :function()
{
var arr=[];
var gr= new GlideRecord('sys_user_grmember');
gr.addQuery('group','your group sys id');
gr.query();
while(gr.next())
{
arr.push(user.toString());
}
return 'sys_idIN'+arr.toString();

Hope this helps

 

MARK MY ANSWER CORRECT IF THIS HELPS YOU