- 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
07-28-2022 05:24 AM
Hi - I'm not sure if there is a import_set_row object is available to access the row number but if you navigate to sys_import_set_row_list.do then you will be able to see row column that you can query and leverage for your purpose.
Regards,
Muhammad
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 05:49 AM
yes its possible, you can use transform script variable error and error_message given below, which can display the error message in error field of import set row records :
if(source.name=="no_tranform"){
error = true;
error_message = "Source is not intended for transformation";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 05:51 AM
I have to display the row number from Excel in my error
- 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 ;
}