The CreatorCon Call for Content is officially open! Get started here.

Trying to send Email after completion import set in Transform Map

yashkamde
Tera Contributor

I am trying to send email after importing the data into the servicenow and here I am using Transform Map Script Event : OnCompletion but not gettting the result.

For that I had registered an Event also called it in notification and in notification also called Email script and in email script I am using template.print() for printing the body of email....

3 REPLIES 3

JenniferRah
Mega Sage
Mega Sage

Is the email being sent? You didn't show your "When to send" tab, so I'm not sure if it's set up to run when the event is triggered.

 

Is the event getting triggered correctly?

 

If all that is working, is the email script not working correctly? If that's the case, can you let us know what you are getting and what you are expecting?

Sure I had attached the ss of "When to send" tab and here I am firing the event but it is not getting triggered.. 
I am actually confused about the onComplete() event script , is that correct taking record and parm as a parameter...?

It should be firing the event using the target as the Instance and the recipient email as Parm1. If you go to sysevent.list and don't see that your event is getting fired, then that's the issue we need to fix. Your code looks fine. You can test the notification by manually creating the event, but the biggest issue is why it's not firing the event.

 

I'm not seeing any examples of other onComplete scripts that fire events. Maybe this isn't an allowed action? Are you getting any errors in the log files that might point us in the right direction? Maybe if you add a gs.log statement before firing the event, we would at least know if the script is running and it might help you find in the log file where an error message is being thrown.