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.

Transform Map Creating New Records Instead of Updating

SNewbies
Tera Contributor

I am using a Transform Map to update the CMDB table with Serial Number as the coalesce field.

Some serial numbers have spaces, like: VMware-42 24 b5 45 02 a9 6a 36-d3 75 78 ad f6 61 8b 41.

When the Transform Map runs, it creates a new record instead of updating the existing one. Could the spaces in the serial number be causing this issue? How can I ensure the Transform Map updates the correct record?

1 REPLY 1

Simon Christens
Kilo Sage

Hi,

Coalesce is _unique_ - so it have to be exactly that value - else its treated as a new record.

You got a couple of possibilities
Remove the spaces from the serial number or find a field thats more consistant than serial number
Ex of a field mapping script that could help you - though its not validated

 

answer = (function transformEntry(source)

	return source.serial_number.toString().replaceAll(' ', '');
})(source);