Auto populate field from a reference field on a catalog item variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 03:52 PM
I have a variable that contains a reference field that references the sys_user table.
I have added another two fields for Email and Department and I would like to have them auto populate with the related information for the selected user in the Requested for field.
How can I do this please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:37 PM
You need a onChange client script for the same as below
var caller = g_form.getReference('requested_for', popCallerInfo);
function popCallerInfo(caller){
g_form.setValue('<user email variable name>', caller.email);
g_form.setValue('<department variable name>', caller.department);
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 06:29 PM
Hi Sanjiv,
Thanks for your quick reply. I have added a client script as you suggested.
I think I have missed a step. How do I make the User email and Department fields display the email address and department. When I click on the drop down the User Name is displayed.
I am assuming I need to add something to the Type Specifications or the Default Value on the two variables. Below is an example of the User Email variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 07:30 PM
Hi @riskay123
We cannot display the email address only because for the user table, Name is the display field means if we refer to user table it will display the name by default and we cannot change it.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2023 02:11 PM
So is there is no way to get the email and department information on the form then?