In the List Tutorial, we provide an importable list archive as a shortcut to setting up multiple lists and lookups. This page describes how you could manually create the same archive from the same sample data package downloaded in the setup step.

Import Files into Lists

Create the lists individually by importing spreadsheets. If you already imported the tutorial list archive, you can skip this step, or create a new set of lists in another folder.

  • Click Manage Lists link in the Lists web part.
  • Click Create new list
    • Name: "NIMHDemographics"
    • Primary Key: "SubjectID"
    • Primary Key Type: Integer
    • Import from file: Check box.
  • Click Create List.
  • Browse or Choose File and locate [LabKeyDemoFiles]/Lists/NIMH/NIMHDemographics.xls.
  • Assume the inferred fields are correct and click Import.
  • Click Lists > above the grid and repeat the Create New List steps for each of the following:
    • Name: "NIMHPortions"
      • Primary Key: "PortionID"
      • Primary Key Type: Integer
      • Import from file: Check box.
      • Select and import the file named: NIMHPortions.xls
    • Name: "NIMHSamples"
      • Primary Key: "SampleID"
      • Primary Key Type: Integer
      • Import from file: Check box.
      • Select and import the file named: NIMHSamples.xls
    • Name: "NIMHSlides"
      • Primary Key: "SlideID"
      • Primary Key Type: Integer
      • Import from file: Check box.
      • Select and import the file named: NIMHSlides.xls

Set Up Lookups

There are columns in common between our lists that can be used as the basis for joins between these lists. In order to setup the lists for joins, we need to identify the columns in common.

The steps for editing a list design to make a field into a lookup of a value from another table are as follows. If you are already working with the tutorial list archive, simply examine the list designs where you will already see these changes.

  • In the Lists web part, click NIMHSamples.
  • Click Design then Edit Design.
  • Scroll down and for the SubjectID field, click on the Type property and select Lookup.
    • Folder: [current folder].
    • Schema: lists.
    • Table: NIMHDemographics(Integer).
    • Click Apply.
  • Scroll back up and click Save.

Repeat this process for each of the following lookups. You can add lookups to multiple fields of a given list at once before clicking Save for the list.

ListFieldTable for Lookup
NIMHPortionsSubjectIDNIMHDemographics(Integer)
NIMHPortionsSampleIDNIMHSamples(Integer)
NIMHSlidesSubjectIDNIMHDemographics(Integer)
NIMHSlidesSampleIDNIMHSamples(Integer)
NIMHSlidesPortionIDNIMHPortions(Integer)

If you view, for example, the NIMHSlides lists, you will now see hyperlinks in the SubjectID, SampleID and PortionID columns where you have set up lookups.

Export List Archive

Now that you have created a useful package of interconnected lists, you can package them as an archive for use elsewhere.

  • From the Lists web part, click Manage Lists.
  • Click Export List Archive.
  • All the lists in the web part will be included in the zip file that is downloaded.

Import a List Archive

Once you have created and exported an archive, you can reuse it later (as we did in the tutorial example) by importing the archive:

  • In the Lists web part, click Manage Lists.
  • Click Import List Archive.
  • Browse to and select the list archive: ListDemo_NIMH_ListArchive_XXXX.lists.zip in [LabKeyDemoFiles]/Lists/NIMH.
  • Click Import List Archive.


previousnext
 
expand allcollapse all