Linking widget for multiple reference columns selected

Hi there,

from Linking widgets - Grist Help Center

Flight record might have fields ‘DepartureAirport’ and ‘ArrivalAirport’, each of which is a Reference to the table Airports.

Currently, it seems I can only select to show all flights departing from specific airport or all flights arriving to it.
In this example, I was wondering is there any possible for showing linking widget on both directions whether from or arriving specific airport, thx.

eg. AIRPORTS → DepartureAirport, ArrivalAirport

Great question!

  1. Make a new column in the Flights table.
  2. Set the column type to Reference List
  3. Set the “DATA FROM TABLE” setting of the column to the Airports table. So now you have a Reference List to the table Airports, just like you already have two References to the same table.
  4. Set the formula of the column to $DepartureAirport, $ArrivalAirport. This will always produce a list containing the two references.
  5. Choose that column under “Select by”.

Here’s what that looks like:

Thanks for your awesome solution, and it did solve my problem.
But with your solution, the All Flights widget become a unwritable widget because of “ValueError Can’t save value to formula column”.

image

Could you consider stopping save value when the widget linked to a formula column to make the widget writable.

But with your solution, the All Flights widget become a unwritable widget because of “ValueError Can’t save value to formula column”.

Oooooh, that’s an excellent point.

I just want to double check: the “All Flights” widget should still be writable - you mean the “Flights with selected airport” widget, right?

Could you consider stopping save value when the widget linked to a formula column to make the widget writable.

I’ve actually written a fix for this problem ages ago, but we weren’t sure if it was an improvement overall and never decided what to do, so it’s just sitting around. The problem is that when you add a new row, the formula usually won’t have a value that fits the widget linking, so the new row gets filtered out immediately and it makes it look like it wasn’t added at all. It’s not clear what good user-friendly behaviour would be.

My bad! I wrote it wrong! I did mean “Flights with selected airport” widget is unwritable.

I just want to double check: the “All Flights” widget should still be writable - you mean the “Flights with selected airport” widget, right?

Thanks for your clear explanation.
In my immature opinion :sweat_smile:, when creating new row in a multiple reference columns linking widget, simply ignore writing anything to a formula column and make the widget able to create new row will make it more handy and useful. (In this case)Or I have to create another two widgets to handle From and To situation :sob: .

I’ve actually written a fix for this problem ages ago, but we weren’t sure if it was an improvement overall and never decided what to do, so it’s just sitting around. The problem is that when you add a new row, the formula usually won’t have a value that fits the widget linking, so the new row gets filtered out immediately and it makes it look like it wasn’t added at all. It’s not clear what good user-friendly behaviour would be.

Followup question: is there any way to do this if the two reference columns refer to different tables, instead of both referring to Airports?