Passing more than two parameters in event queue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 08:31 AM
Hello Folks,
I'm trying to pass 4 parameters thru event queue from a scheduled job run script. In parm 1 I'm passing sys_id for recipients, parm 2 passing Json object to use in mail body. I need to pass two more parms thru event queue. But it is not working. Can anyone help me out to pass more than two parm thru event queue to use in mail body.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 08:42 AM - edited 02-12-2024 08:43 AM
Hi Naveen,
Use below method to pass multiple parameters:
var jsonObj = {};
jsonObj.name = 'Abel Tuter';
jsonObj.email = 'abel.tuter@example.com';
gs.eventQueue('Event Name', GlideRecord Obj, recipientArray, JSON.stringify(jsonObj));
In the email script use this to parse the json
var jsonObj = JSON.parse(event.parm2);
var email = jsonObj.email;
var name = jsonObj.name;
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 09:04 AM
I'm triggering event thru scheduled job and I've written script for JSON obj there. How can i use script in mail script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 09:13 AM
Hi naveen,
You can add multiple parameters in JSON
Please refer to below thread:
Please mark it as helpful (or) correct if it helps.
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 08:49 AM - edited 02-12-2024 08:50 AM
Hi @Avee90 ,
As you already using the JSON for parm2, you can add more values in the same JSON and later parse the JSON and retrieve the value.
Refer the API page
-Thanks,
AshishLM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution