Display group members from particular group dynamically in the reference type variable
						
					
					
				
			
		
	
			
	
	
	
	
	
Options
			
				
					
	
			
		
	- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎03-12-2024 11:08 PM
I have record producer, in that record producer we have a variable with type reference, we want to display the group members dynamically in that particular group. Help with the reference qualifier
		1 REPLY 1
	
		
		
			
			
			
					
	
			Options
			
				
					
	
			
		
	- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎03-12-2024 11:30 PM
Hi @Sai Santhoshi Assuming you have 2 variables
Group --Referenced to group table
User --> referenced to User table
Create a function within script include like below
getMember: function(grpName){
        var gr = new GlideRecord('sys_user_grmember');
        gr.addQuery('group', grpName);// group name comes from variable
        gr.query();
        var members = [];
        while(gr.next())
        {
            members.push(gr.getValue('user'));
            //gs.info("mem"+members);
        }
        return 'sys_idIN' + members.toString();
    },
Call the above funtion in your User variable's reference qualifier like below
javascript:new ScriptincludeName().functionName(current.variables.variableName);
	Regards
Harish
			
			
				
			
			
			
			
			
			
		Harish
