Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This node interacts with the "Field" resource and performs the "List All" operation. It is designed to retrieve a list of all fields from a specified source, such as a database or API. This functionality is useful in scenarios where you need to dynamically access metadata about available fields, for example, when building dynamic forms, generating reports, or integrating with other systems that require knowledge of field structures.

Practical examples:

  • Fetching all fields from a collection to display them in a dropdown menu.
  • Generating documentation or data mapping templates based on available fields.
  • Validating input data against existing fields.

Properties

Name Type Meaning
Split Into Items Boolean Whether to output each element of an array as its own item. If enabled, each field will be returned as a separate item; otherwise, all fields are returned in a single array.

Output

  • The node outputs a JSON object containing the list of fields.
  • If Split Into Items is enabled, each field is output as a separate item (one per n8n item).
  • If Split Into Items is disabled, all fields are returned as an array within a single item.

Example Output (Split Into Items: false)

{
  "fields": [
    {
      "id": "field1",
      "name": "First Field",
      // ...other field properties
    },
    {
      "id": "field2",
      "name": "Second Field"
      // ...other field properties
    }
  ]
}

Example Output (Split Into Items: true)

Each item:

{
  "id": "field1",
  "name": "First Field"
  // ...other field properties
}

Dependencies

  • May require connection details or credentials for the underlying service (e.g., API key, URL, authentication) depending on the system being queried.
  • No explicit external dependencies are visible in the provided code, but ensure any required n8n credentials are configured.

Troubleshooting

  • Missing Credentials: If the node requires authentication and credentials are not set up, it may fail to connect or return an error indicating missing or invalid credentials.
  • Empty Output: If no fields are found, the output may be empty. Ensure the target resource contains fields.
  • Unexpected Output Structure: If "Split Into Items" is not set as intended, the output format may differ from what downstream nodes expect.

Links and References

Discussion