Sep 12, 2019 02:47 PM
It seems this may not be a robust as I’d hoped.
This works great for assigning a task to a project.
If I now go to the projects table I can still assign an already assigned task to a different project and this then carries back through to ‘pollute’ the task can only be assigned to one project constraint I set up.
Seems the many to one is not truly in the database but just in the selection phase of the app.
Worst case I could hide the link field in the Projects table and replace it with a lookup showing the same thing - this will force users to initate the link in the tasks table where the front end entry is enforcing the one-to-many while still allowing view of tasks.
Is this just a limitation or is there a way I can work around this?
Thanks,
Sam
Solved! Go to Solution.
Sep 12, 2019 06:20 PM
You can work around it by using the “Limit record selection to a view” feature.
Create a view in the Tasks table called “Available Tasks”, and filter that view to show only tasks where the Project field is blank.
In your Projects field, tell the Tasks field to limit selection of Tasks to the “Available Tasks” view. Now, when initiating the link from the Projects table, only Tasks without a Project currently assigned will show up in the list, or a new Task can be created.
I agree though, that the failure to enforce one-to-many validation from the “one” side is a strange oversight.
Sep 12, 2019 06:20 PM
You can work around it by using the “Limit record selection to a view” feature.
Create a view in the Tasks table called “Available Tasks”, and filter that view to show only tasks where the Project field is blank.
In your Projects field, tell the Tasks field to limit selection of Tasks to the “Available Tasks” view. Now, when initiating the link from the Projects table, only Tasks without a Project currently assigned will show up in the list, or a new Task can be created.
I agree though, that the failure to enforce one-to-many validation from the “one” side is a strange oversight.
Sep 12, 2019 06:33 PM
Better work around than I had planned - nice one.
A shame that I can’t create a task from inside a project but at least your way I can assign a task without breaking the one-to-many.
Thanks!
Edit: I take that back - your suggestions still allows for adding a new task. Perfect!
Nov 23, 2023 05:18 PM
This issue is still unresolved as of the date of posting. While the workaround 'works' I believe it is imperative that if the 'Allow linking to multiple records' is turned off on the 'many' side of a one-to-many relationship (for the foreign key linking field), it should be able to be circumvented entering the data from the 'one' side.
Additionally, the documentation (https://support.airtable.com/docs/understanding-linked-record-relationships-in-airtable#relationship...) supports correct manner in principle but does not implement correctly.
When can we expect a fix?