How to see import log when a transform map script run?

Suyash Joshi
Tera Contributor

Hi all,

I am facing an issue while  running a transform map script (on complete) I want to transform a large excel file in which I want to count all the record via number with each record respectively with their sys_id.

 

Code ://

(function runTransformScript(source, map, log, target /* GlideRecord */) {
// Your transformation logic here

// After your transformation logic is complete and you want to insert the record
if (target) {
var newRecord = new GlideRecord('your_target_table');

// Set the fields on the new record as needed
newRecord.field1 = target.field1;
newRecord.field2 = target.field2;
// ... (set other fields)

// Insert the new record
var newSysId = newRecord.insert();

if (newSysId) {
log.info('New record inserted with sys_id: ' + newSysId);
// You can use newSysId in subsequent processing if needed
} else {
log.error('Failed to insert new record');
}
}
})(source, map, log, target);

 

I still unable to get response on Import logs!!

Everything consider as a help.

Regards,

Suyash

1 ACCEPTED SOLUTION

You can add below line in transform script to add the comment in import row

source.sys_import_state_comment = "Row Transform succcesfull" ; //Comment in Import Row

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

7 REPLIES 7

You can add below line in transform script to add the comment in import row

source.sys_import_state_comment = "Row Transform succcesfull" ; //Comment in Import Row

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Transform map script (onComplete)- should not run with comment

Run script of the same interface run successfully.

Thank You for the best help I searched many time but not get anything.

Thanks and Regards 

Suyash

Glad to know that my response helped. Please mark response helpful as well.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP