What exactly does the coalesce field on a field mapping?

Jacob64
Kilo Guru

Hi All,
We have a table transfer map that inserts exernal master data from an interface to the core_company table.
This works fine for the whole company record but gives issues on the contact field value's and the parent field.
At first the field was populated with a new value (without email information etc) causing issues as this field is mastered by another sysyem. So now wh have plenty new users that we have to delete every day.

So we want this field to be unique.
When changing the Choice action field at the field mapping and change it to Ignore we expect it to ignore the wrong value from the interface and leave it as it is. But now the field is emptied every time.
We cannot use the reject option as that wil make the whole record to be rejected insteat of only this field.

So looking further i see the coalesce field which i can set to true.

In general it is writen that that wil make the field to nood to be exactly the same. Sounds as a possible solution but is that so?

Can someone explain what will happen if we set this field to be true?

Many thanks in advance!

Kind regards
Jacob.

 

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@Jacob64 

let the coalesce field search the target record, you can use onBefore transform script to access the target field value

If the target record is inactive then if you wish you can ignore the entire row

something like this in transform script

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	if(target.active.toString() == 'false' && target.emailField != '' && target.userIdField.toString().indexOf('@domainname') > -1){
		// all 3 conditions matched so ignore
		ignore = true;
	}

})(source, map, log, target);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader