- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2022 07:54 PM
Hi All,
I need to send a notification to certain group when transform map fails, I am using schedule to run the transform map daily.
I also require a notification with the number of insert, update, etc and other notification should trigger when transform map fails.
Please guide me here
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 01:18 AM
Hi @Priyanka145 ,
You don't have to deal with Transform Maps for this. In your BR that you have written on Transform History table , use the below script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var message = "";
var grLog = new GlideRecord("sys_import_set_row_error");
grLog.addQuery("run_history", current.getUniqueValue());
grLog.query();
while (grLog.next()) {
message = message + grLog.error_message + " for Row Number - " + grLog.row.getDisplayValue() + "\n";
}
if (message != "")
message = "<b><u>Error in data transformation:</b></u> <br\>" + message;
gs.eventQueue("th.transform.status", current, message, "");
})(current, previous);
Now finally add this message that you have sent in your event as parm1 to your notification as shown below :
Now when your event will trigger if there is any error while transform, it will appear in your notification:
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 04:18 AM
Hi @Priyanka145 ,
Yes, so if you see all these values of inserts/updates/skipped/ignored are stored in Transform History table.
Now inorder to retreive these values you need to pass record of this table only in the event so that notification could access these fields from the passed record.
Also make sure you select the Table name as Transform History even if you are calling it through event only. This helps in selecting field names
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 04:52 AM - edited 10-26-2022 05:17 AM
Yes, I am writing notification on Transform history table only and even my BR is on the same table, and also the event that is creatd is also on same table
I will try above but meanwhile can you also please let me know how can I get the comment for those skipped or ignored ones.
I also need to display what is the reason for the skipped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 05:34 AM - edited 10-26-2022 05:35 AM
For ignore/error messages, you will have to GlideRecord to the Import log [import_log] table with query, level IN 1,2 and import_set=current.set
Then build a message variable concatenating the value of message field of import_log table. In the end send this message as a param1 in your event and print this param in notification body.
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 07:17 AM - edited 10-26-2022 09:28 AM
I am able to display the values for insert, update, etc as per your approach. Thanks for it
Could you please help me with the script or with the screenshots as I am new to Transform maps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 01:18 AM
Hi @Priyanka145 ,
You don't have to deal with Transform Maps for this. In your BR that you have written on Transform History table , use the below script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var message = "";
var grLog = new GlideRecord("sys_import_set_row_error");
grLog.addQuery("run_history", current.getUniqueValue());
grLog.query();
while (grLog.next()) {
message = message + grLog.error_message + " for Row Number - " + grLog.row.getDisplayValue() + "\n";
}
if (message != "")
message = "<b><u>Error in data transformation:</b></u> <br\>" + message;
gs.eventQueue("th.transform.status", current, message, "");
})(current, previous);
Now finally add this message that you have sent in your event as parm1 to your notification as shown below :
Now when your event will trigger if there is any error while transform, it will appear in your notification:
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh