Filter a dependency column based on the value of row

This question has been asked before but the solutions are gone so I will ask again and document the answers for others. I have a list of 100 tasks that are associated with different project and I want to let the users choose what dependencies based on other tasks. But the task list of 100 items is too long so I want the select list to only show the choices related to the current project.

I the column I want to filter is a “dependency” column in Coda which means it makes you leave it as a relation column linking to itself. Based on this I chose options from the settings and try to use a custom filter there. I can get any formula to work here and return different values for different rows. Normally I would refer to another table with the project lists and use the linked relation there to show the choices but here it won’t work.

If there is not an easy solution here I will make an example and share it with the community.

Thanks