Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Skip rows when uploading Import Set

Andrew122
Mega Expert

I have an excel file that I want to be able to use in order to upload multiple forms at once.  Is there a way that I can have the import process ignore what is written in the second row of the excel file?

1 ACCEPTED SOLUTION

Thanks for the help, though that script didn't work.  I was able to make one that did because of your help, it was just 

if(source.sys_import_row == 0){
     ignore = true;
}

View solution in original post

2 REPLIES 2

ARG645
Tera Guru

You can ignore any row by setting the row number in the variable rowInExcel_toIgnore

Below is the OnBefore Transform Script in your transform map.

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

  var rowInExcel_toIgnore = 2;
  
  var sourceRowLocation = source.getLocation();
  
  if(sourceRowLocation == (rowInExcel_toIgnore - 2))
     ignore = true;

})(source, map, log, target);

Thanks for the help, though that script didn't work.  I was able to make one that did because of your help, it was just 

if(source.sys_import_row == 0){
     ignore = true;
}