LogiUpSkill

gsftsubmit

In ServiceNow, forms often contain buttons like Update, Resolve, or Close.
Behind many of these buttons, ServiceNow uses a function called gsftSubmit.

gsftSubmit is a client-side JavaScript function used to submit a form and trigger a UI Action’s server-side logic.

Why gsftSubmit?

In ServiceNow, UI Actions can contain :

– Client-side code

– Server-side code

But the server-side code will NOT run automatically when a button is clicked.

To move execution from client → server, the form must be submitted.
This is exactly what gsftSubmit does.

Syntax of gsftSubmit 

gsftSubmit(null, g_form.getFormElement(), ‘action_name’);

Explanation of each parameter :

1. First Parameter – sysId

null

-Usually kept as null

2. Second Parameter – formElement

g_form.getFormElement()

-Represents the current form

3.Third Parameter – action_name

‘action_name’

– Must exactly match the Action name of the UI Action.

 Example :

Create UI Action
  • Table: Incident

  • Name: Resolve Incident

  • Action name: resolve_incident

  • Client: True  

Gsftsubmit