How to trigger notification through event when data loaded and got error through Transform map

Chaitanya Redd1
Tera Guru

Hello Team,

I'm trying to trigger a notification when any user's try's to load a data using transform map and he gets few error/skipped/ignored.

I have created notification and trying to trigger using event but how to use event on transform map table. 

 

Can anyone help me with the steps if possible.

Thanks,

Chaitanya

1 ACCEPTED SOLUTION

Hi Chaitanya,

in that case you need to query the staging table with the import set number and print the information

Sample below: just enhance it

(function runMailScript(current, template, email, email_action, event) {
   
template.print("<table width=70% border=1><tr bgcolor=#e2e0de><td>Row</td><td>State</td><td>Error</td><td>Comment</td></tr>");

var gr = new GlideRecord('staging table');
gr.addQuery('set', current.set);
gr.query();
while(gr.next()){

template.print("<tr><td>gr.sys_import_row</td><td>gr.sys_import_state</td><td>gr.sys_row_error</td><td>gr.sys_import_state_comment</td></tr>")

}

template.print('</table>');
   
})(current, template, email, email_action, event);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Hi Chaitanya,

in that case you need to query the staging table with the import set number and print the information

Sample below: just enhance it

(function runMailScript(current, template, email, email_action, event) {
   
template.print("<table width=70% border=1><tr bgcolor=#e2e0de><td>Row</td><td>State</td><td>Error</td><td>Comment</td></tr>");

var gr = new GlideRecord('staging table');
gr.addQuery('set', current.set);
gr.query();
while(gr.next()){

template.print("<tr><td>gr.sys_import_row</td><td>gr.sys_import_state</td><td>gr.sys_row_error</td><td>gr.sys_import_state_comment</td></tr>")

}

template.print('</table>');
   
})(current, template, email, email_action, event);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Sorry for late update on this. Thanks for help it worked.

You are welcome

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader