Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Item → List

AI-generated

Overview

This node operation lists items from a specified collection in a Directus database. It is useful for retrieving multiple records with options to filter, sort, group, and aggregate data. Users can control the number of results returned, apply search queries, and export the data in various formats such as JSON, CSV, or XML. Practical examples include fetching all articles from a blog collection, retrieving user data with specific filters, or exporting sales records for analysis.

Use Case Examples

  1. Fetch all items from the 'articles' collection with a limit of 50 results.
  2. Retrieve items from a 'products' collection filtered by category and sorted by price descending.
  3. Export a list of users in CSV format with aggregated counts of user roles.

Properties

Name Meaning
Collection Name Unique name of the parent collection from which to list items.
Return All Whether to return all results or only up to a given limit.
Limit Maximum number of results to return when 'Return All' is false.
Split Into Items Whether to output each element of an array as its own item.
JSON/RAW Parameters Whether the query and/or body parameters should be set via the value-key pair UI or JSON/RAW input.
Body Parameters Body parameters as JSON or RAW when JSON/RAW Parameters is true.
Additional Fields Additional optional fields to customize the query such as aggregation functions, export options, filtering, sorting, grouping, and metadata.

Output

JSON

  • items - Array of items retrieved from the specified collection.
  • exportData - Binary data of the exported file if export option is used.
  • meta - Metadata about the response such as pagination info.

Dependencies

  • Directus API with appropriate authentication

Troubleshooting

  • Ensure the collection name is correct and exists in the Directus instance.
  • Check API authentication credentials if requests fail due to authorization errors.
  • Validate JSON/RAW parameters syntax to avoid malformed request errors.
  • If using export options, verify file name and format are supported.

Links

Discussion