younifyd
Menu

Get Relation By Collection

List relations in collection

POST/relations‎/{collection}

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Get Relation By Collection action (under Relations).
  3. Fill in the fields below, then reference the result from later steps as {{getRelationByCollection.response.data}}.

Request

Path parameters

collectionstringrequired

Unique identifier of the collection the relations reside in.

Response

Returns 200 with an object. Read it in later steps with {{getRelationByCollection.response.data.<field>}}.

dataarray<object>
idinteger

Unique identifier for the relation.

many_collectionstring

Collection that has the field that holds the foreign key.

many_fieldstring

Foreign key. Field that holds the primary key of the related collection.

one_collectionstring

Collection on the _one_ side of the relationship.

one_fieldstring

Alias column that serves as the _one_ side of the relationship.

one_collection_fieldstring
one_allowed_collectionsarray<string>
junction_fieldstring

Field on the junction table that holds the many field of the related relation.

sort_fieldstring
one_deselect_actionstring
json
{
  "data": [
    {
      "id": 1,
      "many_collection": "directus_activity",
      "many_field": "user",
      "one_collection": "directus_users",
      "one_field": null,
      "one_collection_field": "string",
      "one_allowed_collections": [
        "string"
      ],
      "junction_field": null,
      "sort_field": "string",
      "one_deselect_action": "string"
    }
  ]
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Was this page helpful?
Get Relation By Collection — Directus — Documentation