- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 02:41 PM
I cannot use the cmn_location table so the Select Box was an option. I need to add options to search dynamically. I tried to do this script. The script is not working for me
function onLoad() {
var fieldname = "please_select_your_professional_service_line_reporting_office_name";
g_form.clearOptions(fieldname);
g_form.addOption(fieldname, '', '-- Select a Location --');
var locations = [
'Mt Doom',
'Middle Earth',
];
locations.forEach(function(location)
{
g_form.addOption(fieldname, location, location);
});
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 06:54 PM
Hi @wyattfudal ,
your script don't have any issues.
check if the UI type of the client is set to ALL or not if not change it to All and try
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 06:54 PM
Hi @wyattfudal ,
your script don't have any issues.
check if the UI type of the client is set to ALL or not if not change it to All and try
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 08:14 PM
your script should work fine provided your choice value and choice label are both "Mt Doom" and "Middle Earth"
share your choices screenshots
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader