How to keep new generated record(s) sys_id during transferring XML data source to another instance

Ecelik3
Tera Expert

I am trying to transfer groups between our instances (create new group or update an existing group). I am using transform map as XML format (using XML data source). I am also using sys_id as  coalesce. If I am updating any groups with different fields from source instance, I am able to update target instance as expected without affecting any sys_ids. If I insert new group in source instance, I can retrieve that group in target instance, but problem is on target instance its generating with different sys_id. It's not bringing same sys_id (as information) as other fields. How can I retrieve its sys_id as well from source without generating new sys_id to target. 

Note: I am trying this as alternative of importing/exporting XML as automated.

Thanks

 

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ecelik,

 

Create an On Before Transform script with the script as

if (action == "insert"){
target.setNewGuidValue(source.u_sys_id);
}

 

Thanks,

Pradeep Sharma

View solution in original post

2 REPLIES 2

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ecelik,

 

Create an On Before Transform script with the script as

if (action == "insert"){
target.setNewGuidValue(source.u_sys_id);
}

 

Thanks,

Pradeep Sharma

Thanks a lot Pradeep Sharma,

 

I didn't know that this issue has a simple solution!