- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2022 05:53 AM
Hello
I have three catalog variables in my service catalog item form.
Based on Requested For variable, Auto populate email and department .
How to achieve this requirement
I want achieve this through Script Include and Client Scripts.
Thanks in advanced
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2022 05:58 AM
Hi,
Something like this should work. Create a catalog client script and give it the property of "OnChange" then select the onchange for the "requested for" field and put in the following script.
Don't forget to put UI Type on "All"
g_form.getReference('requested_for', callBack);
function callBack(user){
g_form.setValue('usr_department',user.department);
g_form.setValue('usr_email',user.email);
}
Kr!
Robin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2022 05:57 AM
Hi,
Please check below link:
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2022 05:58 AM
Hi,
Something like this should work. Create a catalog client script and give it the property of "OnChange" then select the onchange for the "requested for" field and put in the following script.
Don't forget to put UI Type on "All"
g_form.getReference('requested_for', callBack);
function callBack(user){
g_form.setValue('usr_department',user.department);
g_form.setValue('usr_email',user.email);
}
Kr!
Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 09:26 AM
The "new" right way to do this is to use the "Auto-populate" functionality available since Utah release.
In your variable form, you have a tab "Auto-populate" with 3 fields:
Dependent question : Choose the reference variable (in your case "Requestor")
Reference : filled automatically with the related table (in your case, sys_user)
Dot walk path : Choose the field that contains the value you want to populate (in your case, Requestor.Email for the Email variable for example)
More information here.
No need to script anymore 😉
If usefull, please mark as helpful.