Send email notification from a Transform Map script

Dazler
Mega Sage

Hi, I have been tasked with creating an inbound action from an excel sheet.  I got this working.  My excel sheet imports and then creates the Requested Items as it should.

One of the things is that once my excel sheet imports, then in my transform map I have a gliderecord that checks the User table to make sure the user has an account within ServiceNow.  If they do not have an account, then we need the transform map to send a notification for the users on the excel sheet that we didn't find in ServiceNow.  I know that I can't use html mail script in this.

How can I achieve this?  I have reviewed several links, but none doesn't provide great instructions.

This is what I've tried.  In my tranform map, I have added the following event queue.

find_real_file.png

 

I set up an event registry and then a notification.

find_real_file.png

find_real_file.png

 

But this is not working.

Any help would be appreciated.

1 ACCEPTED SOLUTION

MrMuhammad
Giga Sage

1. Replace current with source in the gs.eventQueue method. 

gs.eventQueue('new_hires_not_found', source, source.u_hiring_manager_eamil, hiringMgr);

2. Check Event Logs to confirm whether or not the event is getting triggered or not.

3. If the event triggers then the issue is with notification.

4. Make sure "Event param 1 contains recipient" is checked on the notification.

 

Regards,
Muhammad

View solution in original post

10 REPLIES 10

MrMuhammad
Giga Sage

1. Replace current with source in the gs.eventQueue method. 

gs.eventQueue('new_hires_not_found', source, source.u_hiring_manager_eamil, hiringMgr);

2. Check Event Logs to confirm whether or not the event is getting triggered or not.

3. If the event triggers then the issue is with notification.

4. Make sure "Event param 1 contains recipient" is checked on the notification.

 

Regards,
Muhammad

Hi, thank you for replying back.  I changed it to source.  But I am not seeing it being trigger in the event log.  My transform map is an onBefore script.

find_real_file.png

I am not sure what is wrong.

Have you placed any logs to check whether the if condition is getting satisfied or not? 

For testing purposes, lets place eventQueue outside the condition and see if it gets triggered.  

Regards,
Muhammad

You were right.  I got it working.  It was my condition.  During my testing, my records showed that the user existed in ServiceNow.  What I need on the excel for testing was a user that does not exist in the system.  Once I corrected that, then I could see it in the log and the notification worked.