Choice list options should be visible as per other three choice field selection in record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 10:40 PM - edited 02-22-2023 10:42 PM
Hi All ,
I have requirement in a record producer there 4 choice variables based on the 3 choice variables selection the choice list should populate in the 4th choice list.
Example there are Field 1 : 'Name' which has choices ( Anita , Nithya , Sunita, Swetha )
Field 2 : 'Address' which has choices ( Pune , Bangalore , Chennai , Mumbai )
Field 3 : 'State ' which has choices ( Closed , Open , Onhold , Incomplete)
Field 4 : 'Software' which has choices ( Azure , Microsoft , Google, Jira )
Name | Address | State | Software |
Anita | Pune | Closed | Azure |
Nithya | Bangalore | Open | Mircosoft |
Sunita | Chennai | Onhold | |
Swetha | Mumbai | Incomplete | Jira |
So when in name field ' Sunita' , in address field its 'Bangalore , state field is 'Onhold' then in 'Software' field choices Microsoft and Google should show as choice and other choices Azure and Jira should be hidden.
Similarly as per the other choices same Software field choices should change.
i have tried onChange client script of Name field :
Var aa = g_form.getValue(' Name');
Var bb= g_form.getValue(' Address');
Var cc= g_form.getValue(' State ');
Var dd= g_form.getValue(' Software');
if (aa=='Sunita' && bb=='Bangalore' && cc=='Onhold')
{
g_form.removeOption('software' , 'azure' , 'Azure');
g_form.removeOption('software' , 'jira ' , 'Jira ');
g_form.addOption('software', 'microsoft ', 'Microsoft');
g_form.addOption('software', 'google', 'Google ');
}
@Ankur Bawiskar @Saurav11 @Ratnakar7

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 11:01 PM
Hi @ServiceNow10sun ,
To which table you've added this record producer ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 11:57 PM
@ServiceNow10sun
1) Please confirm that you want only those cases which is mentioned in below table.
2) The user will fill out all three fields on the form, namely Name, Address, and State, and we will only need to write logic for the software? is my understanding correct?
Name | Address | State | Software |
Anita | Pune | Closed | Azure |
Nithya | Bangalore | Open | Mircosoft |
Sunita | Chennai | Onhold | |
Swetha | Mumbai | Incomplete | Jira |
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 12:38 AM
Hi ,
User will select the choice from the fields 'Name' , 'Address' and State and selected choices only should be visible in the field ' Software' .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 01:05 AM
You can try this way:
Var bb= g_form.getValue(' Address');
Var cc= g_form.getValue(' State ');
Var dd= g_form.getValue(' Software');
g_form.clearOptions("software");// Add this to clear the options first and then you can just add the conditional options as describe below
if (newValue=='Sunita' && bb=='Bangalore' && cc=='Onhold'){
g_form.addOption('software', 'microsoft ', 'Microsoft');
g_form.addOption('software', 'google', 'Google ');
}
else if( newValue == 'Anita' && bb == 'Pune' && cc == 'Closed'){
g_form.addOption('software', 'microsoft ', 'Microsoft');
g_form.addOption('software', 'google', 'Google ');
}
else if( newValue == 'Nithya' && bb == 'Bangalore' && cc == 'Open'){
g_form.addOption('software', 'microsoft ', 'Microsoft');
g_form.addOption('software', 'google', 'Google ');
}
and so on for the further conditions..
Please add the options based on your test case, as I can only explain how we can accomplish this because I don't have the entire use case.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.