- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 09:39 AM
Hi Team,
In a schedule job I had an event, and in the event through array I am passing two numbers... so how can I get those numbers in notifcations.
while(gr.next())
{
arr.push(gr.number);
}
gs.eventQueue('trigger.an.event', gr, arr);
Now arr contain two numbers like.. INC000301, RITM000201..
and I created a notification, in "when send" I selected "Trigger by event" and selected event name...
Now my doubt is in email body how did I get the numbers which was in arr?
can some one please help me..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 11:19 AM
Looks okay to me.
Can you put a Log in your Mail script after line number 6 as below:
gs.info('Value coming in param is ' + getArray);
Please check on what is coming.
Also just to be extra cautious not sure might be the cause, try changing the Name of your email script to something else like as below:
"getDetails"
Also remove the space between the colon and your Mail script name in your notification and write it as below:
${mail_script:getDetails}
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 10:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 10:43 AM
Hi,
In order to get your array values which you are passing from your Schedule job is as below:
1) Create a Notification email script and use the below sample script as shown below:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var getArray = event.parm1.toString();
var splitStr = getArray.split(',');
for(var i=0;i<splitStr.length;i++){
template.print('Value is '+ splitStr[i]);
}
})(current, template, email, email_action, event);
This will print array elements and now you can call this Notification email script in your notification using the syntax below:
${mail_script:Notification email script name}
Above is a sample script, you can modify it if needed as per your requirement.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 10:54 AM
Thanks for your response...
In notification I am getting output like below..
${mail_script : triggermailscript}
here "triggermailscript" is my email script name... what's wrong in it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 11:00 AM
Can you share screenshot of your Notification email script configured and your Notification as well here to help you further.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 11:10 AM