Tables, subtables and lookups

Hi, I am trying to create a simple app but most likely I think in the ”excel” way and not the ”coda” way and therefore I am not able to get this to work. I am new to coda so bare with me…

I have three tables where the main one handels transactions. For each transaction I have to select a company which is in another table. This I have solved and I have a dropdown in the first column of the transaction table that allows me to select the company.
In the second column of the transaction table I would like to be able to select only the types of transactions that are applicable for that company. I have a third table which has a the name of the company in the first column and the transaction type in the second. A company can have multiple entries in this table.

In ”pseudo code” I would like to:

SELECT investment_type from tbl_transaction_types WHERE company = ”tbl_transactions.company”

Looked at the recipe example but that does not create a dropdown, only lists the ingredients with a comma inbetween.

Thanks

Hi @Erik_Markman,

you can have filtered lookup based on another column selection.
Have a look at this minimal sample:

As you can see, in the Transaction lookup, if you open the Item setting section you see the filter related to the Company column.

I hope this helps.
Cheers!

4 Likes

Thanks @Federico.Stefanato !
I managed to get it to work but I am not 100% sure I fully understand the filter. How should I interpret it? CurrentValue is the alternative (A, B, C etc) from the table you do the lookup against and that is compared to what’s in the company table, allowed transactions column? Did I understand it correctly?
Thanks again!

Hi @Erik_Markman,

CurrentValue is widely used in formulas and is quintessential in the Coda’s conceptual model.
Its practical meaning can vary a bit in the contexts but you’ll get soon familiar with it.

In this use case, CurrentValue represents a way to refer to the lookup list itself.

If we could instruct the column settings in plain English, it would be:

  1. "Hi Column, I wish you’d be a Transaction" (Select Column Type)
  2. “Therefore I can select from the list of all Transactions” (implicit lookup on the Transaction Table)
  3. “Of all those transactions, please be only the ones that the Company (your sibling column) tells it might have” (CurrentValue here is the be…)

I don’t know if I clarified the concept or just the opposite, but I hope it helps :slight_smile:

Cheers!

2 Likes

Thanks @Federico.Stefanato
I appreciate the simplified explanation.
Best regards
Erik