{event.param1} and ${event.param2} in notification doing the same thing.

dev115415
Tera Expert

Hello

I am sending email from ServiceNow using Event triggering approach. 

I want to fetch the data from the 3rd and 4th parameter of eventQueue

gs.eventQueue('x_1041234_needlt.eventForSendingMail', '' , 'London', 'England'); as written in script include

                   Now in notifications, in email body, if I tend to use {event.param1}  then it returns England and not London as expected. Like both {event.param1} and ${event.param2} returning the same thing.

13 REPLIES 13

Hi @dev115415 ,

Not sure why parm1 and parm2 are returning same value , it should give different values ideally. Can you try running eventQueue by providing a glideRecord object instead of '' as the second argument and see if it works for you.

gs.eventQueue('x_1041234_needlt.eventForSendingMail', '<glideRecord Objec>' , 'London', 'England').

Thanks.

 

 

 

@Asif Khan M Yes it worked fine after giving current as a 2nd parameter in gs.eventQueue.

Please note that I have no use of glide record object in the app I am building. So I used a '' there. But it caused the servicenow to treat both param1 and param2 as the same.

Could you please suggest me what to do in this case now as I do not want to send a glide record object. Is there some other method or way?

jaheerhattiwale
Mega Sage
Mega Sage

@dev115415 gs.eventQueue function expects a gliderecord object in 2nd parameter like below

 

gs.eventQueue("EVENT NAME", "GLIDE RECORD OBJECT", "PARAM 1", "PARAM 2");

 

So glide record object is missing in your case.

 

Add that and check.

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale  My business logic has no use of glide record object. So I do not want to send that in the 2nd parameter. If I just write '' there then it works but causing problem in event.param1

@dev115415 That is what is causing the issue because the gliderecord object is required.

jaheerhattiwale_0-1685689200476.png

 

Documentation: https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/c_GlideSystemScopedAPI

 

You have added the notification on some table right. Use the glide record object of that table to pass in 2nd param to eventQueue function.

Please mark as correct answer/Helpful based on impact.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023