How to pass more than 2 parameters to the eventQueue and access it on the notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 02:05 AM
Hi,
I am using an eventQueue on the scheduled job and passing object as a param1.
var arrFinal = [<sys_id> of users];
var obj = {
iteration: iterValIncFinalVal,
lastDate: storeValNextItr
};
gs.eventQueue('cmp_qualifier', gr, obj, arrFinal);
I need to access both the object value of event.parm1 to be accessible on the notification subject and body.
Can this be achieved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 02:19 AM
Hi,
if you are not using parm1 and parm2 for setting recipients then you can use both the parameters to send the values and get that in email script
This will require you to set the recipient from Users/Group field
What's your case?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 02:27 AM
Hi,
parm2 has the array of users. I am pass an array as parm2 which is basically the users to who the notification will be sent.
parm1 will have 2 values as an object, I need to access both the values in the notification subject and on the notification email body.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 02:21 AM
Hi,
You can access these values in email scripts and parse it to print the values:
var obj = JSON.parse(event.parm1);
var iteration = obj.iteration;
var lastDate = obj.lastDate;
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 02:30 AM
I have added the below code by creating an email script. How to access this in the email notification?
Email script:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var getParamValue = JSON.parse(event.parm1);
gs.info('getParamValue: ' + getParamValue);
gs.info("getParamValue.iteration:" + getParamValue.iteration);
gs.info("getParamValue.iteration:" + getParamValue.lastDate);
})(current, template, email, email_action, event);