Specify which objects to display and make selectable for a given relation

Describe the solution you’d like

As in a real database one should be able to (optionally) specify the type of object that can be selected in a relation. For example, when selecting participants in a meeting I would only like to see and be able to select objects of the type ‘contact’ or ‘human’, not any other type that’s present in AnyType.


Edit 1: There’s a similar feature request by @lynxlove suggesting relation scope (limiting to which types a relation is applicable), I figured people interested in this idea could also like that one. You can find it here: https://community.anytype.io/t/-/1553

23 Likes

There is a relation ‘collection of’, there you can specify what for types can hold the collection.

But i do not know how to use it, i can specify the type, but then … i do not know how.

(I think it is only for internal use)

Did you mean this ?

Instead of using the ‘object type’ relation ?

Or mean you in a common way ?

Would love this request:

I already raised one for Relation Scope:

https://community.anytype.io/t/-/1553

Where a type can only show relations which belongs to it

What you suggested is something similar to relations, where an object relation can only show types suitable to the relation :grinning:

Having the both of them is really important and should bring a lot more flexibility to Anytype. I’d link your request in mine to let people know there’s a similar request but for Relations

3 Likes

@Michael Oh yeah, that’s interesting! It looks like you can only select types in a ‘collection of’ relation, but it looks like it’s still something fundamentally different than only being able to select objects of a certain type (as opposed to selecting types).

@lynxlove Yes, exactly! And great, your suggestion about relation scope makes a lot of sense! I’ll add your request in as well.

Most of the time I don’t know exactly all the Relations a Type might need when we first create it. For example, when I create a “Country” type, I might add Relations for name and continent, but forget some others that could be useful.

Usually I think of new Relations as I create Objects for that Type. For example, as I was creating the Object “Japan”, I realized I also wanted the “Country” type to have a Relation for flag.

However when that happens I need to go all the way back into the “Country” type and add it there.

I’d like to have the option to also add it to the Type, so it’s suggested for all other Objects of that same type.

4 Likes

For example, I have a relation called “Continent”, which takes in Objects.

I only want it to accept objects of the “Continent” Type.

This is just an example. Would be good to allow other situations, such as:

  • Allow any type
  • Allow just a certain number of types
  • Require one type, and allow a couple others

etc.

1 Like

https://community.anytype.io/t/-/1622

1 Like

@lynxlove Thanks!

I always search before posting but often fail to find existing topics :confused:

I would love this feature as well, and would like to extend the request: Allow the relations to be bidirectional/synced.

For your example, if you assign “Asia” to “Japan” as its “continent” (relation), make it so that the “Asia” object also gets a relation “country”, where Japan is automatically added.

@hasenrain The following are requests for automatic bi-directional relation:

1 Like

Looks like this is available in 0.22.3 version of the desktop app :tada:

I’m on 0.22.3 but don’t see this. Are you sure this is available?

Yes. There seems to be an option available to select which object types are applicable for an object relation. Try creating a new object typed relation. You can also check few pre defined relations which also has the restriction set, eg: Tasks relation in the Task type.
You can check the following report for screenshots

Oh interesting. Thank you very much. I tried it for existing relations that don’t have a restriction set I guess, which explains why I wasn’t seeing this feature.
Thanks!

So it’s best if the existing ‘object’ relations (those default relations created by Anytype) can also support limit object types.
@Vova

1 Like

You right! We want to create the system which can be configured completely.
So we will add more actions for Anytype objects in future releases!

3 Likes

I’d like to bring this back because in the past couple of days I’ve been filling Anytype with with actual working info and there have been at least 4 time where I need to set the limit about what object a relation can display and choose from, like in the image bellow.

This is one example. It has happened with other type object relations I’m working with.

Thanks.