Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Item → Get

AI-generated

Overview

This node operation retrieves items from a specified collection in a Directus database. It is useful for fetching data records by their unique ID or querying multiple items with various filters, sorting, and aggregation options. For example, it can be used to get a specific article by its ID or to fetch a list of products with applied filters and sorting.

Use Case Examples

  1. Fetch a single item by its unique ID from the 'articles' collection.
  2. Retrieve all items from the 'products' collection with a limit of 50 results.
  3. Get aggregated data such as the count or average of a field within a collection, grouped by a specific attribute.

Properties

Name Meaning
ID Unique ID of the file object to retrieve (required for single item fetch).
Collection Name Unique name of the parent collection from which to fetch items (required).
Return All Whether to return all results or only up to a given limit (boolean).
Limit Maximum number of results to return when 'Return All' is false.
Additional Fields Additional query parameters such as aggregation functions, export options, filtering, sorting, grouping, and metadata to customize the data retrieval.

Output

JSON

  • id - Unique identifier of the retrieved item.
  • collection - Name of the collection from which the item(s) were retrieved.
  • data - The actual item data or list of items retrieved from the collection.
  • meta - Metadata about the response, such as pagination info or aggregation results.

Dependencies

  • Directus API endpoint and authentication credentials

Troubleshooting

  • Ensure the collection name and item ID are correct and exist in the Directus instance.
  • Check that the API credentials have sufficient permissions to read from the specified collection.
  • If using filters or aggregation, verify the JSON syntax and field names are valid.
  • When exporting data, ensure the binary property name and file name are correctly set to avoid data loss or errors.

Links

Discussion