Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get groups based on requested for user

kasturi4
Tera Contributor

Hi,

I have a requirement to show only the groups based on the requested_for, I am able to fetch the groups by hardcoding the reference qualifier. The below are details

1. requested_for - reference - sys_user

2. group_name - lookup select box -sys_user_grmember 

Reference qualifier : active=true^user=<sys_id_user>

 

I tried the ref.qual this wat -> active=true^user=g_form.getValue('requested_for');

Can anyone help on this. 
Thanks in advance!

5 REPLIES 5

Ratnakar7
Mega Sage

Hi @kasturi4 ,

 

Please try with below reference qualifier:

 

 

 

javascript &colon; 'user=' + current.requested_for;

 

 

 

 

 

Thanks,

Ratnakar

Chetan Mahajan
Mega Sage

Hi @kasturi4 ,

                          Don't use Active in group member ref qual. as there is no active option its just mapping of users and group. Use Simple ref Qual. on Requested for (Active-is-true) And Advance Ref Qual. on Group Member as below

 

ChetanMahajan_0-1675855566944.png

Kindly mark correct and helpful if applicable

 

This is working but it returns sys_id of Groups. How do I convert this to Display Value of Groups?

pjftenorio_0-1694669444765.png

pjftenorio_1-1694669464050.png

 

v