Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 10:38 PM
Hi All,
For below OnSubmit script, I am getting syntaxerror: unexpected end of json input servicenow. Can someone please suggest what can be rectified?
function onSubmit() {
var type = g_form.getValue('request_type');
if (type != 'Delete') {
var mrvsData = g_form.getValue('multiple_staff_id');
var parsedData = JSON.parse(mrvsData);
var rowCount = parsedData.length;
if (rowCount > 20) {
alert('Please do not add more than 20 records in the excel sheet/ attachment.');
return false;
}
return true;
}
if (type == 'Delete') {
var mrvsData2 = g_form.getValue('delete_multiple_users');
var parsedData2 = JSON.parse(mrvsData2);
if (parsedData2.length > 20) {
alert('Please do not add more than 20 records in the excel sheet/ attachment');
return false;
}
return true;
}
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 11:25 PM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 11:25 PM