younifyd
Menu

Get Relation

Retrieve a Relation

GET/relations/{id}

Use it in a workflow

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

Request

Path parameters

idintegerrequired

Identifier for the object.

Query parameters

fieldsarray<string>

Control what fields are being returned in the object.

metastring

What metadata to return in the response.

Response

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

dataobject
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.