We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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

HugoFirst
Kilo Sage

Look at the dictionary entry for "assigned to" on the task table.  I think it does what you want.

https://YOUR_INSTANCE.service-now.com/nav_to.do?uri=sys_dictionary.do?sys_id=726739940a0a3c740101f7d959dc73cc%26sysparm_view=advanced

Muhammad Khan
Mega Sage

@Cédric Chen 

Here is a working example

Script Include

find_real_file.png

function isGroupMember() {
	
	var grUser = new GlideRecord('sys_user_grmember');
	grUser.addQuery('group', '<sys_id_of_your_group>');
	grUser.query();
	
	var userArray = [];
	while(grUser.next()){
		userArray.push(grUser.getValue('user'));
	}
	
	return 'sys_idIN' + userArray.join();
	
}

Reference Qualifier

find_real_file.png