Can We bypass the mandatory field in a form
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2014 07:30 AM
Hi ,
Can we submit a form by not filling the mandatory field .Is that possible through any script or any method.
Please share your ideas.
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2021 03:27 AM
https://community.servicenow.com/community?id=community_article&sys_id=d05b9dd0dba67c10457ae6be139619ee

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2021 09:06 AM
You can Try using below code in UI Action. It will work...
function callClientScript() {
//Client Script
var arr = g_form.getMissingFields();
for (var x = 0; x < arr.length; x++) {
g_form.setMandatory(arr[x], false);
alert("Following mandatory fields are not filled : " + arr[x]);
}
gsftSubmit(null, g_form.getFormElement(), 'update_to_p1');
}
if (typeof window == 'undefined')
callServerScript();
function serverScript() {
// Server Script
current.update();
action.setRedirectURL(current);
}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2021 09:11 AM
You can try below code on UI action. It will work.
function callClientScript() {
//Client Script
var arr = g_form.getMissingFields();
for (var x = 0; x < arr.length; x++) {
g_form.setMandatory(arr[x], false);
alert("Following fields are set Non Mandatory: " + arr[x]);
}
gsftSubmit(null, g_form.getFormElement(), 'update_to_p1'); // UI action name
}
if (typeof window == 'undefined')
callServerScript();
function serverScript() {
// Server Script
current.update();
action.setRedirectURL(current);
}
Please mark answer helpful if it helped.
Regards
Pawan K Singh