- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 12:25 PM
Unable to convert sys_id into Names. Help!!!
Current codes works and returns
When the line in orange is enabled.
But the underlying function does run Scripts-Background.
function onChange(control, oldValue, newValue, isLoading) {
var access = g_form.getReference('access_level', getAccess);
function getAccess(access)
{
g_form.setValue('time_spec_group',access.time_spec_group);
//g_form.setValue('access_approver',getApprovers(access.access_approvers));
g_form.setValue('access_approver', access.access_approvers);
}
}
function getApprovers(List){
var outString = [];
for(i=0;i < List.length; i++)
{
var user = new GlideRecord('sys_user');
if(user.get(List[i]))
{
var username = user.name;
outString.push(username);
}
}
return outString;
}
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 10:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 12:33 PM
Writing glide record in client script is not good practice, I would suggest use client callable script include and use glide ajax to execute your script include to get the data.
Reference:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 08:34 AM
Hi,
have you tried this: g_form.setValue('access_approver',getApprovers(access.access_approvers.toString()));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 09:24 AM
Hello,
In your function getApprovers(), edit with
return outString.toString();
Please mark my answer correct/helpful if it helped you in any way.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 10:56 AM