Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I show a label on a many to many relationship in Directus?

I have added working, many-to-many relationships to a directus api through the directus admin app, but in the directus app when going to add an item to a collection, the label for the select options are not being propagated. I am able to select items and save everything correctly, so I know the many to many relationship is set up correctly, but I cannot propagate the label correctly. I have tried several different methods, including using the . notation to access fields in the relating collection, but to no avail.

When using dot notation, the relationship never loads and only shows a loading sign, while when putting nothing in label works, but no label.

Below are a couple screenshots:

This is where i put in the label

This is one of the many to many relationships

This is the loading sign that never changes when using dot notation or anything in label.

like image 550
Chris Wray Avatar asked Dec 18 '25 07:12

Chris Wray


1 Answers

I don't believe you need to include the junction table (dot notation), just the field name in the related table, like this: name... and for the template, you need to use a template string, like this: {{name}}

Hope this helps! We're cleaning up the field creation process now to make this more intuitive.

like image 169
RANGER Avatar answered Dec 20 '25 22:12

RANGER