Budibase Relationship Problems: Read
Once I got a working knowledge of Budibase data binding, I feel like I'm past the "I have no idea what I am doing" beginner phase and entered into the "I can probably figure out what key words to search for an answer" intermediate phase. The road from here to "I know how to do this" experienced phase is likely paved with a lot of hands-on time. I think Budibase will be able to cover 90% of what I want with very little effort on my part, fulfilling its promise. But that last 10% could motivate me to examine other tools to add to my toolbox.
One example is how Budibase handles table relationships. For every database table, we have to designate one column as a special display column. When displaying tables with defined relationships to other tables, Budibase can automatically replace an foreign key reference with the display column from that column table. My "vendors
" table has a "name
" column as its display column. Each row in my "transactions
" table has a "vendor_id
" column that points to a row in "vendors
" table. Budibase can combine them so when it shows a row from my "transactions
" table, instead of showing the vendor ID (476) it queries my "vendors
" table and shows the "name
" for that ID instead (Target). This is great and it covers majority of what people would need.
But if I want to go deeper, I'm on my own. My example is my "payments
" table, which was my way of implementing classic double-entry bookkeeping and each row has two transaction IDs. One is a deduction transaction from my checking account, the other a credit transaction for the same amount to my Target card account. I wanted to create Budibase dashboard showing a payment amount from "Checking" to "Target", but those names are two levels away ("payments
" to "transactions
" to "vendors
") and I couldn't find a way to do it within Budibase. I ended up solving my problem with a custom PostgreSQL query that performed multiple table joins, then returned the selected results to Budibase, which then dutifully displayed it as a table. I may find a more elegant way to accomplish what I want in the future, but for today this is good enough while I struggle with other problems.