The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Transform map setting error=true stops Import Set processing - but only sometimes

Joel Hodes1
Tera Contributor

I am looking for clarification regarding the behavior of transform maps when setting error flag to true.

If I assign the value in an onBefore script, then the transform ends and all subsequent rows are left in "pending" state.

If I assign the value in the "run script" section, then that individual row is flagged as error but the transform continues processing other rows.

This is a subtle but important difference in behavior. I have left the logic in the "run script" because I want to flag individual rows with an error without aborting the entire transaction. Can someone please direct me to the documentation that details this logic; I need to be sure that what I have built is correct and will not break if servicenow change the logic with the error flag.

I reviewed this article:

https://community.servicenow.com/community?id=community_blog&sys_id=69ada2a9dbd0dbc01dcaf3231f961996

this states the following:

When "error" is set to true, all processing for that import set will stop.   No additional scripts will be processed, including onComplete.

but this now seems to be inaccurate.

Thank you for any help

 

1 REPLY 1

Sulabh Garg
Mega Sage
Mega Sage

Hello Joel,

Please see the documentation from ServiceNow on Transformation script variables.

Below is the example, However its not mentioned anywhere that system will not processed the remaining rows.

 

Variable name: error

Type: Boolean

Description: When set to true, aborts the current import action and logs an error message in the Import Set Log.

Example:
if(source.name=="no_tranform"){
  error = true;
}

 

 

Please Mark âś… Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark âś… Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg