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.

Insert for Transform map

Priya123
Tera Contributor

hi all

i have a transform map where i have a coalesce field.

I want to only update records if coalesce is true 

No insert if  no match

 

provided the below script on the Run Script on the transform but its still inserting. 

 

(function transformRow(source, target, map, log, isUpdate) {

   if (action == 'insert' ){
        ignore = true;
        }
})(source, target, map, log, action==="update");
11 REPLIES 11

Can you send the screenshot of the field mapping? Have you validated that the data in the source table and target table match properly?

 

Might there be data/data-type differences in the source and target table for which you are using Coalesce?

 

@Priya123 

Priya123
Tera Contributor

so i have couple of onAfter transform scripts , though they dont use the coalesce fields, am using them yp update the certain fields in the records.. 

 

in the end, am giving target.update();

 

i feel this stmt is creating blank records.. so is it ok if i dont give the target.update and will the system still update the records right ??

 

am trying that now, but need to check !