#O2M can't choose foreign key
9 messages · Page 1 of 1 (latest)
@west needle Thank you very much for your answer! But when I type the foreign key manually I've [INVALID_PAYLOAD] Field "id" in collection "socials" is a primary key error...
You can't link from a o2m to the primarykey, the field chosen here will save the id of the collection to that field and you cannot update primarykeys
So I need to create an M2O relationship in my collection 1 and normally the O2M relationship, once connected to the M2O relationship should work?
You don't have to add the m2o (on the directus end) but effectively yeah m2o and o2m are the reverse of eachother so one will come with the other in a properly configured relation 🙂
if you prefer not to add the m2o directly you can just type any name of the foreign key you want to use and that will be created for you
Ok, and in the 2nd case, to create it automatically, if I put a foreign key that doesn't exist yet (so not in blue in the interface), it should be ok?
that should be created when you save