in oncomplete transform script how to retrieve the source field map value.

pavni
Tera Contributor

in oncomplete transform script how to retrieve the source field values

 

i tried like

var xyzparent= source.field_name.toString(); o/p is undefined. can someone help me how to retrieve the field_name value. I have mapped under field maps -- source -- field_name. I am loading some value as source field. it loading in import set. but not able to fetch it.

i just need in oncomplete transform script how to retrieve the source field values

5 REPLIES 5

Harsh Vardhan
Giga Patron

it should be in an onAfter script not oncomplete.

onComplete will be executed after all the rows are transformed. so you will not have access to individual rows.

refer the link below for further details. 

https://developer.servicenow.com/app.do#!/lp/new_to_servicenow/app_store_learnv2_importingdata_kings...

https://docs.servicenow.com/bundle/london-platform-administration/page/script/server-scripting/refer...

pavni
Tera Contributor

i want to get the source field value after completing the transform map. hence i tried with oncomplete. if onafter also how should i retreive latest imported data 

did you try the below line of code in onAfter? any issue happening ? 

 

var xyzparent= source.field_name.toString();

pavni
Tera Contributor

yes i tried, it is not working. for this line, no log also coming in onafter.

but oncomplete, log is coming as undefined