How to import data into a table that having field type is reference?

LinhN
Tera Contributor

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

LinhN_2-1723016572342.png

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. 

LinhN_3-1723017020767.png

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? 

LinhN_4-1723017165044.png

 

 

 

4 REPLIES 4

Mark Manders
Mega Patron

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

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? 

LinhN_0-1723021019775.png

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?

LinhN_1-1723021147315.png

 

 

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

Ankur Bawiskar
Tera Patron
Tera Patron

@LinhN 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader