LogiUpSkill

Script Action

What is Script Action:

Script Actions in ServiceNow are server-side scripts that execute asynchronously when a specific event is triggered. 
They are part of ServiceNow’s event-driven architecture and are stored in the sysevent_script_action table. 

Key Characteristics

 Asynchronous execution: They run in the background via the Event Queue, so they don’t block the current transaction or impact user performance. 
Event-triggered: They are linked to events defined in the Event Registry (sysevent_definition). 
Server-side only: Full access to Glide APIs, Script Includes, and other server-side resources (just like Business Rules or Script Includes). 

How Script Actions Work:

An event is triggered (usually using gs.eventQueue() from a Business Rule, UI Action, Flow, Script Include, etc.). 
The Event Processor picks up the event from the queue. 
The matching Script Action (if active) executes. 

  

In the Script Action, you have access to two main objects: 

 current — The GlideRecord of the record associated with the event (if provided). 
event — A GlideRecord containing event details, especially event.parm1, event.parm2, event.parm3, etc., for passing custom data. 

Usecase:

There is a date field on incident form so whenever user select date after saving the form automatically it should create a Problem Record. 

Execution: 

Navigation: Event–>Registry 

Elementor #15925

Leave a Reply

Your email address will not be published. Required fields are marked *