- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 02:58 AM
In import log error message , is it possible to display the row number of the excel where value is invalid along with the error ?
I am using Use source script to throw an error if the value is invalid as below, Can we bring the row number also where the error is found ?
answer = (function transformEntry(source) {
var user= source.u_assigned_to;
var gr = new GlideRecord("sys_user");
gr.addQuery("name", user);
gr.addQuery("active",true);
gr.query();
if (gr.next()) {
return gr.name;
}
else{
log.error('There is no user available with name ' + source.u_assigned_to);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 06:51 AM
you can use source.sys_import_row to display the current row in error_message like this
if(source.name=="no_tranform"){
error = true;
error_message = "Source is not intended for transformation" + source.sys_import_row ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 06:47 PM
Thanks for this, exactly what I was looking for. This worked:
source.sys_import_row
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 06:48 PM
Thanks for this, exactly what I was looking for. This worked:
source.sys_import_row ;