"Link to table" for primary column?

Is there any way to use the “link to table” function for the primary (ie. first) column in a database? It seems to work for every other column except the first one.

I’m trying to set up a database for members of our organisation, and I’d like the primary column (ie. their names) to be linked in every table.

e.g., say our members are John Smith and Mary Jones, one table might have their contact details, one table might have their location, another table might have where they work, but I want the primary column with their name to be linked to each other table, so that if we add new members they’ll also appear in each table.

Hey @36lryiq2 ,

This is currently not possible.

@nigel do you know if we have a good reason as to why we don’t allow that? Or have we just never gotten around to making it available?

I agree that this is a senseless (and now arbitrary-seeming) limitation, considering that the use for this feature becomes so obvious once you want to split data for something across multiple tables. I suspect part of the reason may be that “link to table” allows multi-select, even if many of us wish we could disable that feature sometimes.

There is a workaround for this, however. Make a normal column contain the “link to table”, then make the primary column of the “Lookup” type which links to the primary field from that table link.

1 Like

Thanks for your response @Alex and cheers for that work-around @dkonigs.

Something that may worth be considering is that this feature is sort of redundant, after playing around a bit I realised you could just create another View, and hide the features you want hidden, and switch between views, rather than having seperate tables. However, it might still be nice to have the feature regardless.

1 Like

I realised you could just create another View , and hide the features you want hidden,

So there is something to consider here.

When it comes to structuring your data in Baserow, you should generally follow the rules of database normalisation (I will release a blog post about that soon on baserow.io) which in your case dictates, that in your scenario (looking at location for example), if a user always has a location and there is always just 1 location per user (1-1 relationship) then yes, it would be correct to have a location column in your users table and just hide it if you need to.

But! If a user can also not have a location (0-N) (there can be an empty value in your row) or a user can have multiple locations (1-N), or multiple users can share a location (N-N) you should always put the location information in a separate table.

These are some general guidelines and I hope it helps organise your data in a clean way :slight_smile:

2 Likes