We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Update and show message in Transform map

suryan
Kilo Expert

I have a transform Map in which I had made field(ST_ID is the field name) as Coalesce, so that only matching records gets updated when user export the excel file and updates it.

I want the transform map not to update or stop updating, when a specific field(ST_Validation_ID) has 'no records' / blank, show the error message about it while transform.

Below is the transform map script :

if(source.ST_Validation_ID == ''){

error= true;

error_message = 'Validation ID is empty.';

}

if(action == 'insert'){

ignore = true;

}

i add log statements in 1, 2, and 5th line but it is not showing any message.

Regards,

Surya

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi Surya



the following is what the documentation states regarding logging in transform maps:



The log object for the current import run. Use this object to log messages such as log.info("<Message>") or log.warn("<Message>"). This object logs to the import log for standard import sets, or other log locations as required, such as for web service imports.


source: http://wiki.servicenow.com/index.php?title=Creating_New_Transform_Maps#gsc.tab=0



Thanks,


Berny


View solution in original post

9 REPLIES 9

bernyalvarado
Mega Sage

Hi Surya



the following is what the documentation states regarding logging in transform maps:



The log object for the current import run. Use this object to log messages such as log.info("<Message>") or log.warn("<Message>"). This object logs to the import log for standard import sets, or other log locations as required, such as for web service imports.


source: http://wiki.servicenow.com/index.php?title=Creating_New_Transform_Maps#gsc.tab=0



Thanks,


Berny


Hi Berny,


In the fist line for testing purpose i add log.info("1"); iam not getting any message .



Regards,


Surya


ok. and that's within a field map script?



Thanks,


Berny


correct