Auto Populate a field value based on another field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 01:06 PM
Hello,
Please I need help on how to auto populate a field value based on the value selected on reference field on a form.
For example, we have a variable set included in this catalog item and we want to auto-populate the value of one of the variables in that variable set based on the value selected on a reference field in the form.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 01:39 PM
You could write onChange Catalog Client Script. Example code is below
var MyVal = g_form.getValue('name_of_the_reference_field').getDisplayValue();
If (MyVal == "xyz") {
g_form.setValue('field_name_to_be_set', 'display_value', 'backend_value') ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 02:06 PM
Hi @Alp Utku,
What will I use instead of the xyz you used in the script please? This is because we won't know the value that users will select in the field until they make their choice for the field and am sure the value will vary by users
Thank you.