{event.param1} and ${event.param2} in notification doing the same thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 10:21 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 10:58 PM - edited 06-01-2023 10:59 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 12:00 AM - edited 06-02-2023 12:01 AM
@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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 11:01 PM
@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.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2023 11:51 PM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 12:02 AM
@dev115415 That is what is causing the issue because the gliderecord object is required.
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.
ServiceNow Community Rising Star, Class of 2023