- 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 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 11:30 AM
Wahhh, after changing the email script name it worked...
Thank you
just one more query.. please help for this... I will create a new question if you want..
Now Output
INC0000001RITM0010001
Expected Output(In table format)
Number |
INC0000001 |
RITM0010001 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 11:47 PM
For that you need to make use of below line of code :
template.print("<br />")
So updated script will look like 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]);
template.print("<br />");
}
})(current, template, email, email_action, event);
Regards,
Shloke
Regards,
Shloke