- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 06:06 AM
auto populate email id when name is selected from the reference field(sys_user)
Form fields
Name(reference from sys_user)
email( to be populate)
tried client script on variable set but its not working,
Kindly help with this simple script.
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 06:10 AM
Here is an onChange catalog client script
Please update the variable names in the below script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var usr = g_form.getReference('USER_VARIABLE_NAME', callBack);
}
function callBack(usr)
{
g_form.setValue('EMAIL_VARIABLE_NAME', usr.email);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 08:06 AM
Sneha,
why are you using script , when you can use dot walking without script. please let me know if this did not help you .
https://docs.servicenow.com/bundle/london-platform-user-interface/page/use/navigation/reference/dot-walking-examples.html