Do not update coalesce field

Ronald Lucas
Tera Contributor

Using Istanbul...

I have a 2 column CSV file to import.   Column A is my Coalesce field.   Column B contains data for the field I want to update.

For some rows in my CSV, the case of the Coalesce field (column A) isn't the same case as what is in the CMDB.   For example, the CSV may contain "abc" but the CMDB contains "ABC".   These match (which is what I want), so data from column B of my CSV is being updated.   But what is also happening is the Coalesce field is being updated from "ABC" to "abc" (which I don't want).

Is there any way I can prevent the Coalesce field from being updated when their case doesn't match?

Thanks,

Ron

5 REPLIES 5

This worked perfectly.  I used it to coalesce on an email address (which is inherently case insensitive) and to add a foreign ID (PagerDuty in this case) without triggering an update to the user's email address.

answer = (function transformEntry(source) {

var gr = new GlideRecord('sys_user');
gr.addQuery('email', source.u_email);
gr.query();
if (gr.next()) {
return gr.email;
}

})(source);