Using the foreign key to show associated Info instead of just ID

I have seen an option in Admin Settings > Data Model which allows us to use associated data of foreign keys.

I have changed it to show name, but unfortunately I don’t see its effect in group by. Am I missing something? or it doesn’t support it?

It works for me. Did you rescan DB field values?

Using the sample dataset, this


Yes, it is showing this info in table, but when I use this field in “group by” it shows the ID instead of name.

You’re missing a step. You need to group by the name from the related table:

1 Like

Yes, Andrew is right. That feature is intended to work with raw data, just as a “beautify” function. If you are using the related table, there’s kinda no point in using it, instead of the related table, as Andrew pointed out.

I know this, but I was trying to work out on the double joins need of mine. In my case the Product Tmpl ID is not directly connected to my Table. For Example my table name is “Table A” the relation is. Table A -> Product -> Product Tmpl (I want to group by my results on a field of Product Tmpl relation).

1 Like

You’ll need to use a database view. Metabase works best with a star schema.

Yep, started working on that, thank you :slight_smile: