Show more than 1 field of relational data field,

Well, this is not currently possible. You may check this post.

But I can recommend a workaround with lifecycle hooks that may help you.

Create a field called display_title or something like this. In beforeUpdate and beforeCreate lifecycle hooks add a new logic that will concatenate your fields last_name, first_name, date_of_birth, nationality in the display_title:

Raw example:

beforeUpdate(params, data) {
   data.display_title = `${data.firstname}, ${data.lastname}, ${data.date_of_birth}, ${data.nationality}`;
}

Recommendation: You also should add some logic to verify if these values exist. Or verify if these values changed before update them.

After you created all that logic, you can choose the display_title to be displayed in relations.

3 Likes