Is there a way to reference columns from multiple related/linked tables with a single formula?
For example, I have a Combined Table where the Name column is a select list generated with the formula: ListCombine(Fruit, Vegg).
Is it possible for the Price column in the Combined Table to dynamically reference the Price column of either the Fruit or Vegg table, based on the source table of the selected Name?
Note: This project involves MANY source tables, so I’m looking for a dynamic solution that avoids hardcoding multiple if() or switch() statements. Ideally, the formula should adapt to the selected Name’s originating table without manual intervention.
I know your example is a simplification, but do you have the possibility to combine ALL your source tables in a single one with a more generic name like ‘Items’?
You could add a ‘Type’ field with values like Fruits, Vegetables or whatever. I’m assuming you have different source tables because each type requires different columns, but in this generic table you could just add any number of columns that is relevant for any of the types. For any given row, most of the columns will be empty since they won’t be relevant to the specific type.
I STRONGLY support Pablo’s suggestion above. Even if you sell/ buy Fruit, Vegetables and Car parts, use a product type column and views to manage your data. It is much more flexible doing it that way.