Need Assistance with Reference Field Population based on List Field Selection

Balpreet_Kaur
Tera Contributor

I am working on my ServiceNow instance.
I have created a custom table called "My Meetings".

In my custom table there is a field called "Attendees".
There is another field called "Meeting Host".

Attendees is a "List Type Field".

Meeting Host is a "Reference Type Field".
In ServiceNow instance I went to System Security > Users.

I have created 10 new users and then I assigned a role to 10 new users - "Meeting user" (Role Name).

Then I went to my custom table "Attendees" field, I wrote a reference qual condition - Roles is Meeting user.

By doing this I am able to see 10 new users which I created in my "Attendees" list type field.

Now among these 10 users I can select which ever user I wanted to in my "Attendees" list.

For example : If I select 4 users in "Attendees" field then those 4 users should also be visible in my "Meeting Host" field which is of reference type.

3 REPLIES 3

Anil Lande
Kilo Patron

Already provide solution for similar question :

https://www.servicenow.com/community/developer-forum/there-is-a-table-called-my-meeting-and-a-field-...

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Amit Verma
Kilo Patron
Kilo Patron

Hi @Balpreet_Kaur 

 

You can put a reference qualifier on meeting type field as shown in snip below :

 

AmitVerma_1-1704274859042.png

 

AmitVerma_0-1704274778691.pngThanks & Regards

Amit Verma


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

Tai Vu
Kilo Patron
Kilo Patron

Hi @Balpreet_Kaur 

You can achieve it with the Reference qual in Dictionary Entry of the Meeting Host field.

Sample below.

When the Attendees field has value, we'll display Users from the Attendees field for Meeting Host lookup. Otherwise, we will display no records. 

javascript: !gs.nil(current.u_attendees) ? 'sys_idIN' + current.u_attendees : 'sys_id=-1';

 

Cheers,

Tai Vu