Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Relation → Get

AI-generated

Overview

This node retrieves relational data from a specified collection in a Directus database. It is useful for scenarios where you need to fetch related records based on a relational field, such as getting related authors for books or related categories for products.

Use Case Examples

  1. Fetching related authors for a book collection by specifying the 'author' field as the relational key.
  2. Retrieving related categories for a product collection by specifying the appropriate relational field.

Properties

Name Meaning
Collection Name Unique name of the parent collection from which to retrieve relational data.
Field Name Name of the field that holds the related primary key, matching the column name in the database.

Output

JSON

  • relationData - The retrieved relational data from the specified collection and field.

Dependencies

  • Requires connection to a Directus API instance with appropriate authentication credentials.

Troubleshooting

  • Ensure the collection name is correct and exists in the Directus instance.
  • Verify the field name is a valid relational field in the specified collection.
  • Check API authentication credentials if the node fails to connect or retrieve data.
  • Common errors include 'Collection not found' or 'Field not found' which indicate incorrect input values.

Links

Discussion