- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 05:29 AM
Hello ,
I have two variables Reference and lookup selectbox both referencing same table.
My requirement is: Both are referencing Business Application table. However the lookup select box field's lookup value field is install_type
How to populate the install_type of selected application on the Select box field.
Eg: Application A install type is Production. So when i select Application A on the reference field, lookup field should populate with Production choice.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 06:57 AM
Hi Param,
If you still need that to be show and present then please find below suggestions
1) Since you just want to auto-populate Install Type based on application selected; please use single line text variable
2) use onchange on Reference variable to populate it
3) set it read-only from that script
Sample Client Script:
Note: Ensure you use proper variable name for
1) business name reference variable
2) install_type variable
3) install_type field from business app table
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
// always set as read-only
g_form.setReadOnly('install_type', true;)
return;
}
//Type appropriate comment here, and begin script below
if(newValue == ''){
g_form.clearValue('install_type');
}
var ref = g_form.getReference('business_app', callBackMethod);
}
function callBackMethod(ref){
if(ref.install_type != ''){
g_form.setValue('install_type', ref.install_type);
}
}
Mark ā
Correct if this solves your issue and also mark š Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 05:48 AM
Hi,
please share screenshot
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 05:54 AM
First variable: Reference field with two columns. But Display field is Application Name.
Second variable: Lookup Select Box on install type field of Business Application Table.
Second variable should be populated with install type based on application selected.
Hope i have explained !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 05:58 AM
Thanks Param for the elaborating. It helps.
If I understand when,
Test1 is selected, Install Type should be set as On-Premise automatically.
Test2 is selected, Install Type should be set as Cloud.
If so, how are Column1 (Test1) & Column2(Install Type) related & what are the field names. Like application, install_type, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 06:10 AM
Hello Jaspal,
You are right.
Variable 1: Column 1- Name
Column 2- install_type
variable 2: install_type
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-18-2020 05:49 AM
You dont have to create 2 fields and populate it separately, you can use the field of the related table on this form. It will be controlled by the referenced record.
Use Configure Form Layout to bring install_type field on the form dot walking on application name field.