How to import data into a table that having field type is reference?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 12:53 AM
Hi guys.
I have a task loading data into a table. This table has 3 fields including Name, Product Model, and Order. When creating a record, the product model is referenced to the Product model table
I also have a file that needs to be imported to this table. But I don't know how to import the product model in the file and as a result, it references to product model like creating by hand.
Please help me how to custom the field map on the transform map table. How to import data and reference them to the product model?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 01:31 AM
You are now mapping based on the name, while it should be the display name according to your first screenshot. Did you already try that?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 01:59 AM
The first screenshot is the table that I want to import. I am mapping the name and this name is referenced to the product model. I have tried to import but it inserted the name only, not the product model. Can you help me with this?
I have used a source script for the Field map. But it seemed that it didn't work. Could you help me figure out what's wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 02:12 AM
Your first screenshots shows the Product models in your instance where the values you are imported are shown as display name. If displayname and name are the same, it should work, but you are mapping to name, that's why I asked the question about the mapping.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 02:20 AM
I could see that the excel contains value present in your Display Name field of cmdb_model table
simply add the field display_name in Referenced value field name for that field map and no need of field map script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader