- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 05:22 AM - edited ‎04-08-2025 07:03 AM
How to update Multiple choice field based on Single text field having Client Script Integer Validation in Catalog Item?
If Single Text Integer field is less than 500 option1 to be selected.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 07:05 AM
you can use onChange catalog client script for this
Something like this but please enhance further
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var integerValue = parseInt(newValue, 10);
var multipleChoiceField = 'your_multiple_choice_field'; // Replace with your actual multiple-choice field name
if (integerValue < 500) {
g_form.setValue(multipleChoiceField, 'option1'); // Replace 'option1' with the actual value for the first option
} else if (integerValue >= 500) {
g_form.setValue(multipleChoiceField, 'option2'); // Replace 'option2' with the actual value for the second option
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 05:28 AM
Sorry your requirement is not clear.
please share some 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 07:01 AM - edited ‎04-08-2025 07:03 AM
How to update Multiple choice field based on Single text field having Client Script Integer Validation in Catalog Item?
If Single Text Integer field is less than 500 option1 to be selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 07:05 AM
you can use onChange catalog client script for this
Something like this but please enhance further
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var integerValue = parseInt(newValue, 10);
var multipleChoiceField = 'your_multiple_choice_field'; // Replace with your actual multiple-choice field name
if (integerValue < 500) {
g_form.setValue(multipleChoiceField, 'option1'); // Replace 'option1' with the actual value for the first option
} else if (integerValue >= 500) {
g_form.setValue(multipleChoiceField, 'option2'); // Replace 'option2' with the actual value for the second option
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 12:29 PM
Hi Ankur,
How to update Multiple choice field based on Single text field having Client Script Floating Validation in Catalog Item?
If Single Text Floating field is less than 500 option1 to be selected.