N-n tables and linking widgets to them? How to?

I have a table of construction contracts. Each construction contract as a “waste disposal area” (sometimes called debris disposal site)

But each debris disposal area can SOMETIMES be used by more than one construction area.

Thus, I have an N-N table, where I link construction contracts with waste disposal area.

Now, I need to select a Construction Site in a Card Widget and see all the waste disposal areas it has, not in a cell with a lookupRecords, but in a Cards List (a widget)

However, the Waste Disposal Areas are not directly linked to the Construction Site. So if I link the two widgets it doesn´t work. I still see all waste disposal areas.

Ok, so you have a single page with two widgets: one for construction sites (card), one for disposal areas (cards list).

In your construction site table, you have a field listing all associated waste disposal sites (using a lookupRecords formula, like you mentioned).

If you go to the disposal area widget, then use the right-hand menu to go to Data (Cards List > Data), can you set Select By to Construction Site • lookupRecords column ? That should make it so that the cards list only shows cards that are connected to the construction site card you are currently looking at/have selected

Ok, so you have a single page with two widgets: one for construction sites (card), one for disposal areas (cards list).

Yup, that is one of the pages And I need the Cards List of Dispisal Areas to show only the cards(records) of the Disposal Areas that were linked to that construction site, in the third, n-n table.

In your construction site table, you have a field listing all associated waste disposal sites (using a lookupRecords formula, like you mentioned).

Actually I don’t. Saw no use for it.

If you go to the disposal area widget, then use the right-hand menu to go to Data (Cards List > Data), can you set Select By to Construction Site • lookupRecords column ? That should make it so that the cards list only shows cards that are connected to the construction site card you are currently looking at/have selected

Now I see a use for it haha. I will try that.

Actually, no, the disposal card widget cant select by Construction Site… ONLY by the n-n table. (SitexDispArea)

Because both tables (Construction Sites and Disposal Areas have references to THAT table (SitexDispArea)

I’m having trouble recreating the issue you’re encountering… here’s a pic of an example database I set up, viewing the page that I was imagining when giving advice – what else should I change/do you need to happen for it to work for your use case?

Hmmm… I see what you have done. You are not using an n-n table. I guess. At least I am not seeing it there.

You have Construction Table and Disposal Sites tables. But not a “Construction x Disposal” tables.

As I understand, you have a REFERENCE LIST on the Disposal Sites table, is that it? Thus you can´t select Disposal Sites from the Construction Table, but only Construction Projects from the Disposal table, is that it?

A join table isn’t super necessary since we can have reference list columns as opposed to just references, as you mention at the end of your comment. The downside of this arrangement is that it’s more difficult to add disposal sites to construction projects (easier to add construction projects to disposal sites)

I’ve just added an additional page showing the reverse of the first page (select disposal site on left, view construction project cards list on right), using this same method

If you want to use a join table, that works too! And is probably the more-correct way to do things, haha. I’ve added in a few new tables to the example database I linked previously that show how that would be set up – very similar, just connecting to the join table instead of to each other

“I’ve added in a few new tables to the example database I linked previously”

where?? Oh my god, it’s just like when I ask my wife where are the socks, after 5 minutes looking for them, and my wife angrily just shows them in front of my nose the entire time!

I am just seeing an image of it, now the link to it.

Sorry, that’s my bad! I thought I had linked it originally, but clearly I didn’t. Here’s the link: https://docs.getgrist.com/mXW9tUtrP7pF/Untitled-document

did you make it public? I had access denied. thanks

I clicked public access, but forgot to click confirm. Should be all set now!

1 Like

It worked, thank you very much. What I had to do was transform the LookupRecords cell in Construction Sites in a Reference List type of column. When I did that, it appeared as an option in the “SELECT BY” of DisposalAreas!