How can I set the import field to match reference field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2020 11:23 AM
Good afternoon. I have large spreadsheet to import to the cmdb_ci_printer table and the spreadsheet contains a column of many different models as show below:
I have most of these models already in my instance in the hardware model table (cmdb_hardware_product_model), however, the names do not match. Pulling from the example above, the "LJ M402dne" lists in the hardware model table as the "HP LaserJet M402dn"
How can I script or create a mapping of all of the models in the spreadsheet to equal the reference field: Model ID in the printer CMDB table I'm importing into, so I don't have to change each of the model names on the spreadsheet?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2020 11:27 AM
You need upload sys_id of model in your spreadsheet for this to work.
OR
You can use reference field mappings like below in your transform map
You should be able to use the Referenced value field name field to set the caller_id field by the userid.
You can do the same for model field on your field map.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2020 11:34 AM
Thanks Sachin, so in the field mapping though, how does the instance know to map 'LJ M402dne' to 'HP LaserJet M402dn'?
Where is that defined exactly?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2020 11:40 AM
It's defined in Referenced field value name in your field map.
When the target field is a reference field, the transform map needs a way to match incoming source values to existing records in the reference field's source table. Since most imports do not provide a 32-character sys_id value, you must specify a column from the reference field's source table that contains values that match the incoming source values.
When there is a matching record, the transform map stores the sys_id of the matching record in the target field. If there is no matching record, the transform map creates a new record in the reference field's table and stores the sys_id of the new record in the target field.
If you leave this field blank, the transform map looks for matching values from the display value column of the reference field table.
For example, suppose you are importing incident records and the incoming data lists user IDs for the Assigned to field. If you leave Referenced value field name blank, the transform map searches for matching values in the User table's display value column: name. By setting the Referenced value field name to the user_name column, you can match the user ID values to the appropriate user records.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2020 11:53 AM
That makes sense, however, in your example you had data in your spreadsheet that was identifiable by something that pre-exists in Service-Now. So I guess I'm not seeing any other way around it other than to use your first option where I just have to copy the name or sys_id of the reference field and paste it into the Model ID column of my import spreadsheet.
Thank you for your response.