Custom reference field

Hello,

I have a json field as a Name for a table in my db.
I would like to have a custom reference field for this field.
Right now it’s outputing toString(name) → [object, object] as a reference display. I would like to display toString(name.FR) or at least JSON.stringify(name)

Thank you for your help,
Best,
Ilias

Hello @Ilias_El-mhamdi,

I can reproduce this behaviour on my side.
Right now, it is not possible to directly modify the displayed custom reference field.

But you can easily achieve the desired behaviour by creating a smart field and setting it as your custom reference field.

For example, you can create:

fields: [{
    field: 'displayName',
    type: 'String',
    get: (record) => {
      return Object.values(record.name)[0];
    }
  }],

Now bind displayName to the custom reference field.

It will no more display [object, object]

Let me know if it helps :slight_smile:

1 Like

Thank you for your fast reply.
It works !
Thank you very much !
Best,
Ilias

1 Like