- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 10:09 PM
Hi, I'm trying to create a selectbox that changes depending on the selection values in another column.
So I entered the Attributes, Reference qual value and selected Choice value 'Dropdown With --None--'.
But It's still a search box. How Can I change it to select box?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 10:59 PM
Following steps will add a select box on Contract form.
- Open Contract form
- Select hamburger icon > "Configure" > "Form Design"
- Select "Field Types" tab and drag and drop "Choice" to the form
- Select "Field Choice" icon
- Edit Label and Name fields
- Scroll down and edit/add all choices to make available
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 10:19 PM
Hi,
If it's a reference field then why would it have choice with Drop down None?
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
‎04-21-2022 10:37 PM
Hi Jieun,
Is the field suppose to reference values from other table or is it a selection based on defined choices?
Dynamic pull-down list can be created using a field of type "reference" that populates choices from a table. In this case, reference qualifier can be used to dynamically change available choices in the pull-down.
The other option is to create a field of type "Select Box". In this case, choices are defined in a field. onChange() Client Script can then be written to dynamically change available choices depending on other fields.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 10:59 PM
Following steps will add a select box on Contract form.
- Open Contract form
- Select hamburger icon > "Configure" > "Form Design"
- Select "Field Types" tab and drag and drop "Choice" to the form
- Select "Field Choice" icon
- Edit Label and Name fields
- Scroll down and edit/add all choices to make available

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 11:17 PM
To dynamically change available choices, create a onChange() script on u_parent field.
- Click on "Configure" > "Client Script"
- Click on "New"
- Enter script
sample:
function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } if (newValue == 'a9b438c097ea011086d3b4b3f153af9d') { // sys_id of record in u_parent table g_form.addOption('u_branch', 'branch1', 'branch1'); // add option branch1 g_form.addOption('u_branch', 'branch2', 'branch2'); // add option branch2 } else { g_form.removeOption('u_branch', 'branch1'); // remove option branch1 g_form.addOption('u_branch', 'branch3', 'branch3'); // add option branch3 } }​
Execution result:
case 1. If condition in script satisfied. "branch1" and "branch2" added as an option
case 2: If condition not satified. "branch1" removed and "branch2" added.