Email notification with errors from import set in Flow.

Pablo H
Tera Contributor

Hello everyone,

 

little bit of background, I have create a flow for catalog item, user will attach an excel file and via flow, data is automatically imported to the target table. 

 

As a next step, I would like to add email action to the flow if errors occure during the data import, the email should contain all of the error messages. Can you advise what is the best approach to do this?

 

Thank you

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Pablo H 

better to use direct notification on table sys_import_set_run (Transform History).

You can call this notification from your flow using Send Notification action

something like this to show the status of inserts, updates, ignored, skipped etc

Email script:

(function runMailScript(current, template, email, email_action, event) {

	template.print("Total:"+current.total+"<br/>");
	template.print("Inserts:"+current.inserts+"<br/>");
	template.print("Updates:"+current.updates+"<br/>");
	template.print("Ignored:"+current.ignored+"<br/>");
	template.print("Skipped:"+current.skipped+"<br/>");
	template.print("Errors:"+current.errors+"<br/>");
	//}

})(current, template, email, email_action, event);

Import Set Email.gif

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

View solution in original post

8 REPLIES 8

Notification needs to be of 'send when' = 'triggered'


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Ankur ,

I have one requirement similar to this post, please help me to achieve this?

i need to to show the status of inserts, updates, ignored, skipped etc records through email notification with errors from import set  , having around 13 different data sources, need the email script for that .

is it possible to achieve this using one email script and one notification?

 

Regards,

Abhilasha G T

Pablo H
Tera Contributor

Thanks a lot Ankur. Greatly appreciated.

@Pablo H 

Glad to help.

Please mark response helpful as well.

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