Auto populate the value in one variable based on the selection of value in another variable in same variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 05:45 AM
Hi Team ,
i have two variables created in the same variable set in catalogue item
1.u_ou_name : it has text and values under its question choice tab.
2.u_ou : this needs to auto populated with value same that of value in ou_name, when particular text is selected in ou_name variable.
any solution for this
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 06:01 AM
Hi, did you try with onChange client script?
example- we can get the user's manager name through getReference function on the onChange client script as below-
var name = g_form.getReference('username', callback);
function callback(name) {
g_form.setValue('useremail',name.manager_name);
//Similarly you can try with the other relevant fields as per your requirement.
}
Please mark helpful/correct if this information has added value to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 06:01 AM
Hi
Refer to these threads:
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 05:00 AM
HI
tried with below script , but no luck ...any correction.
=================================================
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var org = g_form.getReference('u_ou_name', callBackMethod);
}
function callBackMethod(org) {
g_form.setValue('u_ou', org.u_ou_name.Text);
}