- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-11-2020 08:49 AM
I have 3 arrays to pass to events . Is there a way to pass more than 2 Parameters through gs.eventQueue()
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-11-2020 09:29 AM
Hi Shankar,
you can use array of json objects and pass that in single event parameter in event.parm2
use that in parsing in the email script
sample json should look like; sample email script
[
{
"fieldLabel": "Short Description",
"previousValue": "Test",
"currentValue": "Testing 123"
},
{
"fieldLabel": "Assigned To",
"previousValue": "Abel Tuter",
"currentValue": "David Loo"
}
]
parsing in email script
var str = '[{"fieldLabel":"Short Description","previousValue":"Test","currentValue":"Testing 123"},{"fieldLabel":"Assigned To","previousValue":"Abel Tuter","currentValue":"David Loo"}]';
var parser = JSON.parse(str);
for(var i=0;i<parser.length;i++){
template.print('Field ' + parser[i].fieldLabel + ' changed from ' + parser[i].previousValue + ' to ' + parser[i].currentValue);
}
Mark ā
Correct if this solves your issue and also mark š Helpful if you find my response worthy based on the impact.
Thanks
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-11-2020 08:56 AM
Hi Shankar,
Please refer https://developer.servicenow.com/dev.do#!/learn/learning-plans/orlando/new_to_servicenow/app_store_l... to check what parameters can be passed to the event queue.
Regards,
BG

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-11-2020 09:02 AM
Hi Shankar,
OOB gs.eventQueue() has option to pass only 2 parameters. Would you like to elaborate about your requirement so that an alternate way can be suggested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-11-2020 09:17 AM
I have a requirement to send notifications to a user , when any of the 13 fields are updated . So, created 3 arrays , 1 to capture field labels , 1 to capture previous values and 1 to capture current values

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-11-2020 09:23 AM
Thanks Shankar that helps understand the scenario.
I guess your event would be using a notification so why not you go for an option of mail script that is called in notification body (with format of label, previous, current value) & which is triggered when event is fired.