My database design includes a table with a bunch of record status that is referenced by nearly all the other tables. This is a meditated design decision. So Active, inactive, draft, beta, mark as deleted, etc
Is there any way I can show the referenced field as a badge in the other tables? Even if that means losing the hyperlink to the status table record. It’s not useful anyway to have a link to the status record from other tables.
Hi @jonl welcome to our community, As I understand it, you just can go to the status table settings and under the general panel choose what you want inside reference field.
Hello, is there any update on if this is possible today? I have (I think) a similar use case:
Feature(s) impacted
Allowing reference field to be selected from a foreign-key joined table.
Observed behavior
Given a table, I am only allow to pick a reference field from the columns that exist in that table.
Expected behavior
Given a table, I would like to be able to pick a reference field from not only the columns that exist in that table, but also columns from a foreign key joined table.
Context
Database type: PostGres
Relevant tables:
database=# \d codes
Table "codes"
Column | Type | Collation | Nullable | Default
-------------+--------------------------+-----------+----------+---------
created_at | timestamp with time zone | | | now()
code | character varying | | not null |
label | character varying | | not null |
database=# \d items
Table "items"
Column | Type | Collation | Nullable | Default
-------------+--------------------------+-----------+----------+---------
created_at | timestamp with time zone | | | now()
code | character varying | | not null |
Foreign-key constraints:
"items_code_fkey" FOREIGN KEY (code) REFERENCES codes(code) ON UPDATE CASCADE
database=# \d item_categories
Table "item_categories"
Column | Type | Collation | Nullable | Default
---------------+--------------------------+-----------+----------+---------
created_at | timestamp with time zone | | | now()
item_code | character varying | | not null |
category_code | character varying | | not null |
Foreign-key constraints:
"item_categories_category_code_fkey" FOREIGN KEY (category_code) REFERENCES categories(code) ON UPDATE CASCADE
"item_categories_item_code_fkey" FOREIGN KEY (item_code) REFERENCES items(code) ON UPDATE CASCADE
In this case, I would like to be able to show the label of an item in my item_categories table.
Sorry for the late reply, as you’ve interacted with an old and already resolved topic, our notification system hasn’t picked it up. Please create a new post for inquiries as we would be able to answer in shorter delays.
For your use case; If I understood properly is to set as reference field a field from a relation of the collection.
Which is not possible out of the box, to do so, you will simply need to create a new field in your collection that is imported from your relation, then set that field as reference field
We have a handy function to do just that: importField