Using Lists as Lookup Tables

It can be useful to have lookup tables to convert or transform informaiton from one thing to another. For example, you might have states stored by their two-letter abbreviations in the database, but when the data is published you want to spell out the full name of each state. With CatBase (Version 7.1 or later) you can use Lists to manage this very easily.

  1. First set up your list:
    1. Go to the Admin menu and expand the Lists topic on the left.
    2. Select an existing List, or click New List to create a new one.
    3. Add new List items, if necessary, by clicking on the Add an Item button at the bottom of the list.
    4. When an item has been added to the list, double-click in the Description column for that item.
    5. Enter the alternative text for that item. For example, if the item text is "FL" you would enter "Florida" in the Description cell.
    6. Add all the required options to the list.
  2. Attach the list to the appropriate field:
    1. Select the Database Setup topic under the Admin menu.
    2. Select the table in which the appropriate field resides.
    3. Double-click the field that you want to attach the List to (eg State in the example used here)
    4. Select the Choice List option in the Field Properties dialogue.
    5. Select the list from the pop-up menu that appears next to the checkbox.
    6. Save the field changes.
    7. Place the field on your data entry form using the Form Design Wizard. It will appear as a popup choice list.
  3. Now you just need to tell CatBase to publish the Description instead of the item text:
    1. In your Publishing Stylesheet, add an Element to the Paragraph in which you want the list data to be published.
    2. Select the Elment type: Field.
    3. Select the appropriate field (eg State in this example)
    4. Click on the Preferences tab in the Element dialogue.
    5. Select the Use List Item Description checkbox in the Lists area.
    6. Save it.

That's it! When the data is published using that Publishing Stylesheet, the item descriptions will be published instead of the item text.

Go to CatBase.com