- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2015 12:05 PM
Hi,
How do I import a set of Locations from CSV and still maintain Parent Reference?
I have Locations dumped in CSV and have Fields REGION, COUNTRY, STATE.
Just as in cmn_location table, I would like to have this data of locations imported, to have a Hierarchical Display in the Look up List as for Location field in cmdb_ci.
Could some body help?
Thanks
Hardy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2015 12:44 PM
Hi Hardy,
This can be easily done through transform maps in one go. You'll need couple of things in the data:
- A unique identifier (not sys_id) like a location code. Doing import solely based on plain text is not recommended and more error prone. We will use this as a coalesce field for this transform
- Hierarchy mapped in the data i.e. Parent-Child relationship (As mentioned by Abhiram)
Now while creating the transform map do fieldmaps like this:
Source field | Target field | Coalesce | |
u_name | name | false | |
u_parent | parent | false | |
u_loc_code | u_loc_code | true |
You don't have to write even a single line of code.
Hope this helps.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 09:56 AM
Hi Sumukh
Thanks for advice.
Regards
Hardy