Does the Many-To-One is actualy a Many-to-Many relationship?

Hello All,

I’ve been trying out the Many-To-One relationship
Example:
Each Table A connects with many Table B
and Each Table B connects with one Table A

I would expect from this that in Table A I can use each record only once from Table B.
However I can add the same record from Table B to multiple record in Table A, just like with Many-To-Many relationship.

Can any clarify on this please?
Thank you a lot

Hi @Mihaly,

Is this how your connection field is set up, and is the connection field in Table B?

If so, then you will be able to add Table A records to as many Table B records. For example, I have the Table B record of “banana” connected to more than one Table A record:

In the scenario that you have the connection field in Table A, and it’s setup like below, you will be able to add multiple Table B records to each Table A record:


If you’re still not sure why your connection field is behaving the way that it is, feel free to reach out to our support team for assistance with this and they will be happy to help you set up your connections the way you need them! You can create a support ticket here: Create Support Ticket

Happy building! :slight_smile:

Hi!
Thank you for your support.
The second scenario is what I have.
Adn I would suspect thet in this case, while you can add multiple records to apple (breakfast, lunh), each of these values can be used only once. As its says “Each Table B connects with ONE Table A”
With the possiblity of useing more than once the B records, whats the difference between this, and the Many-To-Many case? as there we can use multiple records multiple times as well

Thanks,
Mihaly

If this was a many-to-many connection field instead, and the connection field was still placed in Table A as you have it now, you would see the same results as the many-to-one connection field.

I believe what you’re looking for is a one-to-many connection field, and for the connection field to be in Table B (so the reverse of what you have).

The table that you place the connection field in is important. We suggest placing the connection field in the data table where you/your end users will be editing records the most, which is typically the table on the “many” side of the connection.

If you decide to reach out to our support team, they will be able to take a look at your app directly, learn your use case, and help guide you in the right direction with designing your database to provide further support. In the meantime, I will share some help articles that provide more in-depth info:

Thank you!
I’m not looking for a solution, just trying to understand the logic and differences.
I designed few databased previously and this made me curious from engineering part rather than on how to apply it. :slight_smile:
And from my understanding the many-to-one allows to add multiple records, multiple times, just like in many-to-many.
I understand that the many-to-one sounds silly, as from db perspective its same as one-to-many, but here in Knack its interesting how it is designed :slight_smile:

1 Like