Forum Discussion

SohumShah's avatar
SohumShah
Qrew Member
3 years ago

1 to 1 relationship with multiple tables

I have 3 tables:
Tag Library - A table containing barcode information for thousands of pre-printed tracking tags
Item Type A - Table of type A items which will be tagged using tags from the Tag Library
Item Type B - Table of type B items which will be tagged using tags from the Tag Library

Once an item (either type) is assigned a barcode tag, the Item Type table will have a "Tag Number" field which will contain the human-readable version of the barcode from the tag (using the "Get this field's value from a lookup field and don't allow the value to change" in the field settings)

Each tag can be used only once. So, if a tag is used on a Type A item, it cannot be used again in the future, and likewise for Type B items.

I have done some research and determined that I will likely need a join table, but the example I saw only has 2 tables, so I am having a little trouble trying to figure out how to set up the relationships and configure the join table.

Thanks in advance!

------------------------------
SJS
------------------------------

4 Replies

  • Sohum, could the type A/B be a field in lieu of two distinct tables?  It seems to me that you need an Items Table and a Tag Table and those could be related.  You could set a "unique field" on the barcode to ensure it is not used twice.

    ------------------------------
    Ivan Weiss
    ------------------------------
    • SohumShah's avatar
      SohumShah
      Qrew Member
      Hi Ivan,

      Unfortunately, I don't think they can. Type B products are created from Type A products so there is a 1-M parent-child relationship between those tables.

      ------------------------------
      Sohum Shah
      ------------------------------
      • IvanWeiss's avatar
        IvanWeiss
        Qrew Captain
        hmmm not sure I am following this from a design perspective....  So are you saying that Type A gets a barcode and might be part of Type B which also gets a different bar code?

        ------------------------------
        Ivan Weiss
        ------------------------------