Abort transform if all rows are empty

Evren Yamin
Tera Contributor

Hello,

 

I have enabled "copy empty fields" on my transform map. I know this means that all empty values will be copied on the instance.

Thus, is there a way for me to check the value of the columns first and ignore the transform if there is a column where all values are empty on the file being uploaded.

 

Like for example, in this file, all rows for short desc is empty. I want for the transform to be aborted if the file being loaded is like this one. 

NumberShort DescDesc
111 test1
222 test2
333 test3

 

Appreciate all the help. Thank you.

 

13 REPLIES 13

@Evren Yamin 

that's correct. it will pick the current import set for which transformation is running

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks @Ankur Bawiskar, but unfortunately its not working, I tried printing the value of both source.sys_class_name & source.sys_import_set but its undefined.

 

@Evren Yamin 

try using onBefore transform script and use error=true to stop entire transformation.

when the 1st row runs and onBefore runs; it will check the fields and if any 1 is empty then error=true will stop entire transformation

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Oh ok but I need to check the entire row if empty. since there are instances where the first row is empty but the second row has values. 

 

Only when the entire row is empty then I will abort transformation

Hello @Ankur Bawiskar, was hoping you have another suggestion for me to check the entire row and abort the transformation if all rows are empty. Thanks so much.