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

this worked partially.. so basically it created new records. but empty ones. Like blank records. am not sure if its cos i gave Copy empty field on the transform map but thats needed for other columns that am updating. 

 

i did onbefore only and it created blank records 

Priya123
Tera Contributor
Create new record on empty coalesce fields
 this as well is unchecked. not sure why is it creating blank records.

Shubham Singh
Mega Guru

Hi @Priya123 

 

Check if the Coalesce is checked for any other fields in field mapping on the transform map. If it is checked for multiple fields, it will consider the record as a match only if all the fields' value matches.

 

Thanks!

Please mark it as correct and helpful if it works ✔️👍

Priya123
Tera Contributor

no only one field is a Coalesce for this map