How do I reference both the "Assignment Group" and "Assigned to" on the same field (Record Producer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 04:32 AM
Hi everyone, Im trying to make a field that references both the "Assignment Group" and "Assigned to" so that when I click on the field and write somethink like "Dev Team" it shows both the Group and the users that are a part of it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:37 AM
your variable is referring to table sys_user_grmember?
If yes then you will require a custom field which is of type string and make it calculated
populate it as this current.group.name + ' ' + current.user.name
Then make this new field as Display=true on the table
OR
since you are making it as reference variable you can add variable attributes to show value of both the fields when user types in something
Example
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=category;serial_number,ref_ac_columns_search=true,ref_ac_order_by=name
Variable attributes sections
Output: I have added category and serial_number as extra fields to be shown along with name
Similarly for your table add this in the variable attributes for that variable
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=group;name,ref_ac_columns_search=true,ref_ac_order_by=name
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 05:36 AM
By this time you might have figured it out that its not possible to make a field referencing to 2 different tables where parents of those tables are not same. and in yours case definitely its not possible.
But instead, you can refer to table named 'group Members' (sys_user_grmember) which contains relationship/membership of user. Now with this new referencing table you will be able to find groups and people present in that group .
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:21 AM
And what would I use as a "Type" for the variable of the Record Producer @sushantmalsure ?
I was thinking "Select Box" but it wont work because it only let's me chose one field from the (sys_user_grmember).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:25 AM
Did you get a chance to check my above response?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:31 AM
I am Little confused with your ask. Can you add a screenshot here?
If you want multiple columns to be visible from membership table then make Type: Reference , reference : sys_user_grmember and in reference qualifier : ref_ac_columns=user;group,
if you want to select multiple values from members table then you can have Type : List Collector ,reference : sys_user_grmember and just add variable attributes : glide_list .
This will create a glide list and you will be able to select multiple records.
Regards,Sushant Malsure