How can we push errors into an error field of sys_import_set_row table via transform map script.

Aanchal Mehndi1
Giga Contributor

How can we push errors into an error field of sys_import_set_row table via transform map script.

I have written few validations in a transform map script, which will ignore the row if condition doesn't matches.As there are many scenarios so I want to push the information in the error field of sys_import_set_row table that why row got ignored.

I didn't see any function in wiki that we can use to push error to error field of sys_import_set_row table via transform map script.

Does anyone have any solution?

11 REPLIES 11

Hi Chris,



This won't work as this is a reference field. I have already tried this but no luck.


For import sets that's only true if you tell it not to. Otherwise what will happen is it will accept it and create a record for it in the referenced table and set that value in the field. I've tested it and it works. Also the "Row transform ignored by onBefore script" is more than likely caused because within the Transform map the "Run Business Rules" checkbox is selected and it means that it couldn't transform that Row because an onBefore Business Rule prevented it.


I have tested with this syntax source.sys_row_error = " your_error_message";




But it's not working..:(


I cannot see anything in error field. It's blank.


And, Run Business rule is unchecked in my transform map.


Hi Aanchal,



I guess that line is put each time we write


ignore=true;


in any of the transform script.



If you want only the error message to be shown, I'd recommend using a new separate field on the source table. Populate this field with your error message.



Thanks,
Mandar


DrewW
Mega Sage
Mega Sage

I use two methods for this



log.info("Some message");


status_message = "Some Message";



The status_message gets added to the comment field of the import set row and the other goes into the log attached to the import set.



More info here


http://wiki.servicenow.com/?title=Transform_Map_Scripts#gsc.tab=0



there is also error_message that can be used.