Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Relation → List All

AI-generated

Overview

This node operation lists all relations from a data source, with options to control the number of results returned, filtering, sorting, and aggregation. It is useful for retrieving comprehensive or limited sets of relational data, such as fetching all related records in a database or API. Practical examples include exporting relation data to CSV or JSON files, applying aggregation functions like count or average on fields, and filtering results based on search queries or specific conditions.

Use Case Examples

  1. Export all relations to a CSV file for reporting.
  2. Retrieve a limited number of relations with specific fields and sorting applied.
  3. Aggregate relation data to get counts or averages grouped by a field.

Properties

Name Meaning
Return All Whether to return all results or only up to a given limit.
Limit Maximum number of results to return when not returning all.
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 input, used when JSON/RAW Parameters is enabled.
Additional Fields Additional optional fields to customize the query, including aggregation functions, export options, filtering, sorting, grouping, and metadata.

Output

JSON

  • data - Array of relation objects returned from the query, possibly split into individual items if configured.
  • metadata - Metadata about the query result, such as total count or pagination info.

Dependencies

  • An API key credential or authentication token to access the data source.

Troubleshooting

  • Ensure the API credentials are correctly configured to avoid authentication errors.
  • If no results are returned, check the filter, search, and limit parameters for correctness.
  • When using JSON/RAW parameters, ensure the JSON syntax is valid to prevent parsing errors.
  • If exporting data, verify the file name and format are correctly set to avoid file generation issues.

Discussion