How to add import log when duplicate coalesce field

MiY
Tera Contributor

If an import finds a target table record with the same values ​​for all joined fields as a staging table record, I would like to output a message in the import log.
Is this possible?

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@MiY 

if all values match then it means it's an update.

you can use onBefore transform script and check the action is update

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

    // Add your code here
    if (action == 'update' && target.fieldA == source.u_fieldA && target.fieldB == source.u_fieldB) {
        log.info('My message');
    }

})(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

@MiY 

Hope you are doing good.

Did my reply answer your question?

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