Forum Discussion

AndreEkespong's avatar
AndreEkespong
Qrew Member
3 years ago

Is there a solution to many-to-many relations and relation to oneself?

I'm fairly new as a developer in QB, but I have long experience from other tools.

How do I handle many-to-many relations between tables in a more general way? In QB you can sometimes use a entity table in between like in the attached diagram, but how to handle relations from one table to the same table? One example would be to have a relation from a (sub)project to a main project and still only have one Project table entity.

Now to something I don't know. Is there a functionality available in QB for a field that acts like a "lookup" field. It would make it possible select from a list from a table or something else and the selected value would be stored in the field.

Can I use a Formula-text field and some code to calculate a reference from table Project to itself or to another table? And make the field and the UI function like a lookup?

/André


------------------------------
Andre Ekespong
------------------------------

  • I'm fairly new as a developer in QB, but I have long experience from other tools.

    Welcome to Quickbase and particularly his Community Forum!

    How do I handle many-to-many relations between tables in a more general way? In QB you can sometimes use a entity table in between like in the attached diagram, but how to handle relations from one table to the same table? One example would be to have a relation from a (sub)project to a main project and still only have one Project table entity.

    A table can be related to itself if one "subproject"  ( which is in fact a project), can only have One Parent .  But if you need to hav3 full flexibility, then you will need an additional join table.  You need to be very careful with your field naming to avoid totally confusing yourself..

    Now to something I don't know. Is there a functionality available in QB for a field that acts like a "lookup" field. It would make it possible select from a list from a table or something else and the selected value would be stored in the field.  


    The very foundation of the power of Quickbase is relationships where you can be in a form and select a Parent or else launch off a Parent to Add a child.

    Can I use a Formula-text field and some code to calculate a reference from table Project to itself or to another table? And make the field and the UI function like a lookup?  

    Yes, absolutely.  The is often used when the Key field of the Parent is a custom Key field. 



    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------