Showing posts with label retain lookup column values. Show all posts
Showing posts with label retain lookup column values. Show all posts

11 September, 2012

Retain look up column values in export list template


It is known issues that on exporting list items, look up column values are lost.
If the list is very big, it might not be possible to fix that manually. This problem occurs since list template does look up on a table using GUID, on creating a list template and exporting to a different site, this GUID changes, hence it is no longer able to retain the values.


Suppose I have a list “Category” which has a look up column “sub category” which refers to list “Sub Categories”. I assume you have already created a look up listSub Categories” in the destination web.

  1. Browse to the source Web’s lookup list “Sub Category” and choose Modify settings and columns.
  2. Copy the source lookup list GUID from the URL.It should be a sequence of numbers and letters similar to:  %7BFFA47BF8%2D849C%2D4F20%2D9C50%2D173D2F5B6725%7D
  3. Browse to the destination Web’s lookup list and choose Modify settings and columns.
  4. Copy the destination lookup list GUID from the URL.Similar as point 2.
  5. Delete %2D from the string and replace with a dash sign (-). There should be no dash sign (-) at the start and the end. GUID should be in the following format: FA47BF8-849C-4F20-9C50-173D2F5B6725
  6. Save the source Web’s list that contains a lookup column “Category” to the lookup list as a list template called category.stp.
  7. Export the list template STP from the source list template gallery to the file system.
  8. Rename the category.stp file to category.cab so Windows can open it.
  9. Open the file, right click on the manifest.xml file and export it to the file system.
  10. Edit the manifest.xml file; find the source Web’s lookup list GUID and replace it with the destination Web’s lookup list GUID.
  11. Save the manifest.xml file.
  12. Open a VS.NET command prompt.
  13. Run the makecab command as: makecab manifest.xml category.stp
  14. Import the new STP into the destination Web’s list template gallery. You will need to delete it if it has previously been imported.