
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 08:54 AM
Nearly home time!
We have a number of service requests that use a list collector to gather a list of users to be added or removed from particular groups. We use 'glide_list,no_filter' in the variable attributes so that the users can be added in a single line entry rather that the typical 'box' view associated with a list collector - see below:
We also use ref_ac_columns=email,ref_ac_columns_search=true etc etc in the attributes so that it shows their email address alongside their name when we search, so that we can uniquely identify each user.
The problem I have is that although the requester has selected their unique users, the support team still only see a field containing Name, and so dont know if it was joe.1.bloggs or joe.2.bloggs that was chosen. They have asked if its possible to add an additional field to the task (yes) but how do I then populate this field with the unique user id of each user selected in the list variable?? Or is it possible to return both Name and User ID in the list variable??
Note I dont want to change the display value on the sys_user table.
Thanks in advance
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 12:26 AM
You can add additional fields below the list collector as a display if glide_list attribute is removed and this is the simplest way to do it.
Refer to this link to see on how it works: https://www.servicenowguru.com/system-ui/customizing-slushbucket/
If you need to go towards the AJAX, then you can try that also
1) You will need to read only variable to display User ID's
2) An onChange client script on the list collector which will make the AJAX call to the server. The value of list collector is a comma separated list of user Sys IDs and you should pass these value to the server side. The same client script will also receive the response back from server and then update the read only variable
3) A client callable script include which receives the values, splits it with a comma separator, Loop and query the user table for each of the SYS IDs and then fetch the User Ids in a Array. The Array should be joined with a comma separator and returned back to the client script to display it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 09:04 AM
Hello,
This should work if the glide_list attribute is removed from the list. If it cannot be done then you need to write an onChange client script and then fetch the required columns using AJAX script and add display it on another read only variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2018 08:34 AM
Ali, removing the glide_list attribute still only shows the user name. The difference is it displays in the RITM as a list collector 'box' view rather than a single line list. So this doesn't resolve the issue.
Now, I need help!
I know nothing about ajax scripting, but happy to give it a go. Had a look at the following post:
Get Related Values from List Collector Selection
I think Abinhay's post at the end may well provide exactly what I need??
You mention client script, but do I also need a script include??
Thirdly, what do I need to replace table/field value wise - obviously in my case the list collector references sys_user table and Name field, and I want to match name field with userid and populate a custom variable, call it u_uniqueid??
Should my script include be client callable, and how do you incorporate the scripted lines auto inserted by Servicenow
And finally, what table would the client script go on
Sorry, I am still very much a novice to all this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 12:26 AM
You can add additional fields below the list collector as a display if glide_list attribute is removed and this is the simplest way to do it.
Refer to this link to see on how it works: https://www.servicenowguru.com/system-ui/customizing-slushbucket/
If you need to go towards the AJAX, then you can try that also
1) You will need to read only variable to display User ID's
2) An onChange client script on the list collector which will make the AJAX call to the server. The value of list collector is a comma separated list of user Sys IDs and you should pass these value to the server side. The same client script will also receive the response back from server and then update the read only variable
3) A client callable script include which receives the values, splits it with a comma separator, Loop and query the user table for each of the SYS IDs and then fetch the User Ids in a Array. The Array should be joined with a comma separator and returned back to the client script to display it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 04:23 AM
Again, thankyou. If I remove the glide_list and do as the article says, I can click on each of the selected records in the RITM to see the unique details.
I'll maybe leave the serious scripting stuff till I have more time to learn it 🙂