AirTable: Add access to linked records other than with line_item
Y
Yuval Kaplan
Many times you have a column that is linked to a single selection in a secondary table. Currently in order to access the data in the secondary table we use line_item in a table. However, many use cases just need to display information of columns in the secondary table not in a table (the only way to use line_item).
Rupert Hoffschmidt-McDonnell
Thanks. Are you using lookups already to pull that data from the related table?
Y
Yuval Kaplan
You are more than Welcome and thank you for the great product.
As to accessing secondary table data, I prefer not to use lookup columns in the primary table in AirTable. The linked table has tens of data points that I wish to use in the document so recreation lookups for so many of them defeats the advantage of linked data tables in AirTable and create a badly structured database. I am used to JSON format where you can access the secondary (or deeper) data with a dot...maybe that or something similar to {{secondary_linkedTableName}}{{dataItemName}}
By the way, congrats on releasing Sections. That will come in very handy!
Rupert Hoffschmidt-McDonnell
Yuval Kaplan: Thanks. It's definitely an interesting idea. What would you do if there are multiple records linked? Separate items with commas like in Lookups in Airtable? Or even defining a separator would be possible of course...
C
Christoph Bernhard
Rupert Hoffschmidt-McDonnell: Rupert, that would be an amazing feature - reducing the size of the tables drastically since all the lookups are not needed any more :) Defining a separator per field would be great since it differs between names, addresses, values and so on.
Still in love with DocsAutomator ;)
Y
Yuval Kaplan
I could suggest a couple of options:
- Use something similar to Dot notation within mustache:
From the top level table: {{data_point}]
For the secondary linked table: {{linked_table_name.data_point}}
For deeper table data: {{linked_table_name.deeper_linked_table_name.data_point}}
Ex:
Say you have a base table Car (make, model) and it has an Engine (power, fuel):
Therefore:
{{make}} - {{model}} has a powerful {{engine.fuel}} engine rated at
{{engine.power}} Hp.
I assume that the parser would search for names ending with a dot and then in the UI you can point to the linked table for 'engine'.
This is already a great improvement even if you don't permit lower level linked tables but enables a syntax that will work for deeper levels as well.
This is a good option when you are mixing different levels of table data. Not sure how this will work for 'line_items' and 'sections'.
- Use a similar construct as 'line_items' or 'section':
Using the above Car example:
The {{model}} has the following engine:
{{linked_engine}}
Power: {{power}} | Fuel: {{fuel}}
{{/linked_engine}}
I think that the first option is much more flexible and offers the possibility of accessing deeper level linked tables but this is a new way of doing things on DocsAutomator.