On Select Reference field variable & populate select box variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 05:08 AM - edited 04-17-2024 05:13 AM
Hello Team,
We have Reference variable in a Catalog form, when reference value is selected then auto populate the select box variable with the corresponding pairs as shown below:-
Reference Var | Select box Var |
AS1041 | APAC |
AS1039 | APAC |
AS1149 | EMEA |
AS1057 | EMEA |
BS1054 | Canada |
BS1725 | Canada |
BS1578 | Canada |
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:06 AM
Hi @Km Sh .
I tried your problem in my PDI and it works for me. Currently I'm doing the reference from sys_user table you can change table as per your requirment.
Please check below
When I select user it changes the drop down value
1.
2.
I created OnChange Client Script on reference field for my case it's user and added this code, Please refer this code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
alert('Inside AutoSelectValue = ' + newValue);
if (newValue == 'be05e21b937331100d5170918bba10c7') { // Give Sys_id of your reference field
g_form.setValue('select_value', 'Canada');
}if (newValue == '1832fbe1d701120035ae23c7ce610369') {// Give Sys_id of your reference field
g_form.setValue('select_value', 'EMEA');
}if (newValue == '62526fa1d701120035ae23c7ce6103c6') {// Give Sys_id of your reference field
g_form.setValue('select_value', 'APAC');
}
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:47 AM
@Community Alums
Thanks for the response.
hmm using Sys_id may not be right approach as its a reference variable & may have a huge list. So using array or alternate option would be better as I understand.
Appreciate your inputs/suggestions.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:59 AM - edited 04-17-2024 08:00 AM
Hi @Km Sh ,
If you want to use for only 3reference values you can use sys_id, or if you have many values dependent on you can share me details . The reasone we need to use sys_id because our dependant value type is reference so it will give us sys_id only.
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:04 AM
Hi @Community Alums
I have approx. 850 reference values(custom table) based on that we need to populate select box variable values as mentioned in the list.
Thanks