- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 02:23 AM
Hi Team,
Please find the below screenshot
Username has the collector which contains the value as reference from sys_user table
For Example:
ameer@gmail.com
I need to write a client script to get those 3 value in comma separated and save it in below user id field
I have a client script for getting one value , Not sure how to get 3 values with comma separated
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var user = g_form.getReference('first_name', getdetails);
function getdetails(user) {
g_form.setValue('email', user.email);
g_form.setValue('user_id', user.user_name);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:40 AM
as per my requirement you code this helps me ,It displays the sys id to string like below
rekha@gmail.com,sal@gmail.com,halit@gmail.com
Code
******
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 02:41 AM
you cannot use getReference on list collector. it can be used only for reference variable
in your requirement you need to use GlideAjax and return the usernames from that function as comma separated value
I hope you will be able to do this using the GlideAjax syntax from docs
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
11-16-2023 04:51 AM - edited 11-16-2023 04:52 AM
Hope you misunderstood my above one. Can you give me the code
I have sample below
Need an output to store this value like this in user id salma@gmail.com , ,rekha@gmail.com ,ameer@gmail.com
Is that possible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 06:35 AM
I have understood the requirement and also informed this is not possible using getReference on list collector
Please use GlideAjax
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
11-16-2023 07:11 AM
@Ankur Bawiskar - i am not sure how to get from GlideAjax
