- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 09:36 PM
Hi,
I have set up data import from prod to lower environments (Data source is XMLs), everything is fine I mean new records are getting created but some of the records are getting created with sys ids and also sys ids of these records are different in prod and in lower environments. Any help is greatly appreciable.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 11:05 PM
Hello Shrikanth,
The sys_id is received in source XMLs for referenced fields.In Field mapping of a reference field , if you haven't put any thing in Referenced value field name then by default system will compare the value from the source table with the display value of the target table's reference field and thus it seems like sys_id from source table is compared with name(display value) of the value in target table's reference field.
you need to do following
1. For Field mappings of referenced fields put sys_id in Referenced value field name. You may need to edit list layout of the field mappings related list to bring this field in the list.
Creating New Transform Maps - ServiceNow Wiki
2. If you want the same sys_id of the target record as in your source instance then you need to create an onBefore transform script with following code.
if (action == "insert"){target.setNewGuidValue(source.u_sys_id);}
Importing from Another ServiceNow Instance - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 10:19 PM
Not that I know off
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 10:22 PM
Thanks kalaiarasan. No problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 11:05 PM
Hello Shrikanth,
The sys_id is received in source XMLs for referenced fields.In Field mapping of a reference field , if you haven't put any thing in Referenced value field name then by default system will compare the value from the source table with the display value of the target table's reference field and thus it seems like sys_id from source table is compared with name(display value) of the value in target table's reference field.
you need to do following
1. For Field mappings of referenced fields put sys_id in Referenced value field name. You may need to edit list layout of the field mappings related list to bring this field in the list.
Creating New Transform Maps - ServiceNow Wiki
2. If you want the same sys_id of the target record as in your source instance then you need to create an onBefore transform script with following code.
if (action == "insert"){target.setNewGuidValue(source.u_sys_id);}
Importing from Another ServiceNow Instance - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 11:14 PM
Is the discussion here of reference fields? I thought it was about the sys id of the records ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 11:21 PM
Well this is what i observed in past that referenced fields in target table getting sys_ids and this is because import set table got sys_ids from source instance. The Name field cannot get populated with a sys_id until its not mapped with sys_id or a referenced field from source table.