- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I want to know the backend working of gsftsubmit ? how is it woking at backend ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Take a look at this thread, it may help you
What is gsftSubmit()'s param??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @sagarpundir ,
The gsftSubmit function is a client-side utility in ServiceNow used to submit forms typically triggered by buttons or UI actions.
It processes like....
Submits the HTML form (<form> element in the DOM) to the server.
- The form submission sends an HTTP POST request back to server to process.
The server then pushes any updates or redirects as per the UI Action definition.
Depending on the UI Action’s server script, the server sends back a response.
- The client either reloads the form with updated data or navigates to another page.
It takes three parameters:
null (First Parameter):
This parameter represents the parent HTML element to which the notification will be appended. When set to null, it typically means that the notification will be appended to the global notification container, which is often located at the top of the page.
g_form.getFormElement() (Second Parameter):
g_form.getFormElement() is the out-of-the-box method. It is used to retrieve the DOM (Document Object Model) element of the current form. In the context of a UI action, this is likely being used to specify where the notification should be attached within the form.
UI Action Name (Third Parameter):
The third parameter is the name of the UI action itself. This is used as an identifier for the UI action and is often included in the message or title of the notification to provide context about which action triggered the notification.
Hope this helps.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
gsftSubmit just adds an extra flag (sys_action) to the form submission.
The server checks that flag → finds the correct UI Action → runs its server code.
Backend Working (Step by Step)
You click the button
Browser runs the UI Action client script → gsftSubmit(null, g_form.getFormElement(), 'close_incident').
Form submission happens
gsftSubmit submits the form like a normal POST request.
Along with form data, it attaches a hidden parameter:
sys_action = close_incident
Server receives the request
ServiceNow’s Form processor sees the request.
It checks:
Which record? (sys_id)
Which action? (sys_action)
Server finds the UI Action
In the sys_ui_action table, it looks for a record with:
action name = close_incident
table = current form’s table
That’s how it knows which UI Action server script should run.
Executes the server-side script
ServiceNow now runs the Server Script of that UI Action.
Example:
current.state = 7; // Closed current.update(); action.setRedirectURL(current);
Response back to client
After server script finishes, it sends a response (redirect, reload, or update).
Browser reloads the form with new values (e.g., incident now shows as Closed).
Shashank Jain

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Take a look at this thread, it may help you
What is gsftSubmit()'s param??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @sagarpundir ,
The gsftSubmit function is a client-side utility in ServiceNow used to submit forms typically triggered by buttons or UI actions.
It processes like....
Submits the HTML form (<form> element in the DOM) to the server.
- The form submission sends an HTTP POST request back to server to process.
The server then pushes any updates or redirects as per the UI Action definition.
Depending on the UI Action’s server script, the server sends back a response.
- The client either reloads the form with updated data or navigates to another page.
It takes three parameters:
null (First Parameter):
This parameter represents the parent HTML element to which the notification will be appended. When set to null, it typically means that the notification will be appended to the global notification container, which is often located at the top of the page.
g_form.getFormElement() (Second Parameter):
g_form.getFormElement() is the out-of-the-box method. It is used to retrieve the DOM (Document Object Model) element of the current form. In the context of a UI action, this is likely being used to specify where the notification should be attached within the form.
UI Action Name (Third Parameter):
The third parameter is the name of the UI action itself. This is used as an identifier for the UI action and is often included in the message or title of the notification to provide context about which action triggered the notification.
Hope this helps.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
where i can find this - > the notification will be appended to the global notification container
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
gsftSubmit just adds an extra flag (sys_action) to the form submission.
The server checks that flag → finds the correct UI Action → runs its server code.
Backend Working (Step by Step)
You click the button
Browser runs the UI Action client script → gsftSubmit(null, g_form.getFormElement(), 'close_incident').
Form submission happens
gsftSubmit submits the form like a normal POST request.
Along with form data, it attaches a hidden parameter:
sys_action = close_incident
Server receives the request
ServiceNow’s Form processor sees the request.
It checks:
Which record? (sys_id)
Which action? (sys_action)
Server finds the UI Action
In the sys_ui_action table, it looks for a record with:
action name = close_incident
table = current form’s table
That’s how it knows which UI Action server script should run.
Executes the server-side script
ServiceNow now runs the Server Script of that UI Action.
Example:
current.state = 7; // Closed current.update(); action.setRedirectURL(current);
Response back to client
After server script finishes, it sends a response (redirect, reload, or update).
Browser reloads the form with new values (e.g., incident now shows as Closed).
Shashank Jain