Can we send a json object as the "current" in gs.eventQueue parameter?

Community Alums
Not applicable

For a new record (not yet submitted), I want to trigger an event which will send basic info about the record to a script action. I am already using both parameters of the event for another purpose. Can I simply create a json object and pass it in event queue as current? Example:

var obj = {

"sys_id" : "123456789",
"table_name" : "incident",
"workflow_id" : "9876544321"
};

gs.eventQueue('event.name',obj,'parm1','parm2');

The event is failing to process and the state is shown as error in Event logs. The script action also is not triggered. I need the data in the object and use it in the script action. Any suggestions?

Thanks in advance

2 REPLIES 2

Himanshu Dubey
Giga Guru

Hi Vishnu,

 

Yes you can send see below link might help you

 

https://community.servicenow.com/community?id=community_question&sys_id=972de173db87ab40107d5583ca96...

Please mark correct and Helpful if it helps

Thanks & Regards

Himanshu Dubey

Dubz
Mega Sage

You need to pass through a glide record there, if the record has not been created yet you can just pass through null and send the object as parm 1 or 2.