Populate List Collector Field with logged in user's group names

nrd5830
Mega Guru

Hi all,

I have a catalog to add or remove users from groups. I have a list collector field which references group table, what I am trying to achieve is to populate this list collector with logged-in users group names both on the portal and classic view, please find below a screenshot of the reference qualifier I am using, still, I am seeing all the groups. This list collect filed is only visible if I select an option to "Remove from group" from another field. Also, I am not using "Requested for" filed on the form to dynamically change the list collector values. Would also appreciate sharing the solution for onChnage as well if I thought of suing "requested for" field in future,

find_real_file.png

Classic View:

find_real_file.png

Portal:

Would like to populate groups as below

find_real_file.png

 

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

You should be using below ref qual

 

javascript:'sys_idIN'+gs.getUser().getMyGroups()

Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

You should be using below ref qual

 

javascript:'sys_idIN'+gs.getUser().getMyGroups()

Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,

 

Thanks for the response, I have another scenario where I want list collector field to dynamically filter the groups based on "Requested For" field, how do I implement it?

You can try below. And you may also need to add Variable attribute in the list collector as ref_qual_elements:requested_for

 

javascript:'sys_idIN'+gs.getUser().getUserByID(current.variables.requested_for).getMyGroups()

 


Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,

 

I have created a 'sys_user' reference field 'service_for' so the list collector should populate groups based on this reference filed value. I tried above reference qualifier condition with attributes you mentioned. It's not working.

javascript:'sys_idIN'+gs.getUser().getUserByID(current.variables.service_for).getMyGroups()