- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 04:27 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 05:53 AM
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);
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 07:00 AM
Notification needs to be of 'send when' = 'triggered'
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 11:24 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 06:15 AM
Thanks a lot Ankur. Greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 06:18 AM
Glad to help.
Please mark response helpful as well.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader