Display value for Belongs To fields
I have a model with fields that reference shopifyCustomer and in the data view I just see the ID number, which isn't validating the reference. The AI is saying you can configure the display value for the field but I'm guessing maybe it's hallucinating that?
https://clhom.gadget.app/edit/development/model/FxxSu5oHu7sj/field/tvnwOsRJP6P8
Gadget Auth - Loading
Gadget Auth


5 Replies
Hello,
What do you mean by validating the reference? Are you talking about making sure that the customer with record id 1 exists?
To answer your question about the assistant's response, that's incorrect
Well, technically, its partially wrong. You can add a custom js validation to check if the parent record exists
Take a look at these docs: https://docs.gadget.dev/guides/models/fields#adding-custom-code-validation
Fields - Developer Docs - Gadget
Gadget Docs
ok got it
Wait, no. What it's saying is completely wrong. You can't change whats displayed in the data viewer
We don't fetch related model data there
Are you trying to add some computed data to the model?
right yeah I was clear on that actually - no not trying to add computed data at the moment just wanted to understand the out of the box functionality