Help

One-to-many link

Solved
Jump to Solution
2815 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Sam_Brown
5 - Automation Enthusiast
5 - Automation Enthusiast

It seems this may not be a robust as I’d hoped.

  • I have set up project and task tables.
  • I would like many tasks to one project.
  • I went to tasks table, created link to projects with “allow linking to multiple records” disabled.

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

1 Solution

Accepted Solutions
Jeremy_Oglesby
14 - Jupiter
14 - Jupiter

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.

See Solution in Thread

3 Replies 3
Jeremy_Oglesby
14 - Jupiter
14 - Jupiter

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.

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!

Keston
4 - Data Explorer
4 - Data Explorer

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?