coalesce on multiple fields and empty fields

joanct
Kilo Contributor

what does "coalesce empty fields" used for ? if i am having my unique key field , I do not want that data coming in empty , so where exactly can this option be used?

another question is , when there are two fields - name and ID and I set both as "coalesce" is there a precedence or how is the insert or update or the record determined in import or web service import? any ideas forum?

2 REPLIES 2

joanct
Kilo Contributor

anyone ? will the empty fields in source system or source file coming from import change the original value on the field in servicenow table ?


conmic
Mega Guru

I found following description on the SN wiki:


http://wiki.servicenow.com/index.php?title=Using_the_Coalesce_Field



1 Overview

In an import, coalescing on a field (or set of fields) means the field will be used as a unique key. If a match is found using the coalesce field, the existing record will be updated with the information being imported. If a match is not found, then a new record will be inserted into the database.


2 Updates Only

To only update records where a match is found, and skip records where a match is not found, specify a coalesce field and add the following script as an OnBefore script to the transform map.


if (action == 'insert') ignore = true;



and here is also some information to be found:


http://wiki.servicenow.com/index.php?title=Creating_New_Transform_Maps#Creating_a_Field_Map



CoalesceSelect this check box to match records in the source table to existing records in the target table. When true, the import set application attempts to match source values to existing target values. When false, the import set application always creates new records for each transformation. If multiple fields are set to coalesce, all coalesce values are used to match an existing record. If two fields are set for coalescing and a matching value is found on one of the coalescing fields but not on the other, a new record is inserted.
Coalesce empty fieldsSelect this check box to match an empty source field value to an empty target field value. For example, the User transform map coalesces on the email field. With this option selected, a source record containing an empty email address coalesces to a target record containing an empty email address.
Coalesce case sensitiveSelect this check box to have case sensitive coalesce values result in the creation of new records. By default, values marked as Coalesce are used in a case insensitive lookup for existing records. Case insensitive records only update existing records and do not cause the creation of new records.