Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node is designed to retrieve information about a specific field within a collection in a data management system. It allows users to specify the collection and the unique field name to fetch detailed metadata or configuration related to that field. This operation is useful when you need to dynamically access field definitions, validate data structures, or integrate with systems where field-level details are necessary.

Practical examples include:

  • Fetching the schema of a particular field before performing data validation.
  • Retrieving field metadata to dynamically build user interfaces.
  • Accessing field properties for audit or documentation purposes.

Properties

Name Meaning
Collection Name The name of the collection containing the field. Options are dynamically loaded from available collections.
Field Name The unique name of the field within the specified collection. Options are dynamically loaded based on the selected collection.

Output

The output contains a JSON object representing the detailed information of the requested field. This typically includes metadata such as the field's type, constraints, default values, and other configuration details relevant to the field within the collection.

No binary data output is indicated by the source code or properties.

Dependencies

  • Requires connection to a backend service or API that manages collections and fields (likely a Directus instance).
  • Needs an API authentication token or similar credential configured in n8n to authorize requests.
  • Utilizes dynamic loading methods to populate options for collections and fields (getCollections and getFieldsInCollection).

Troubleshooting

  • Common issues:

    • If the specified collection or field does not exist, the node may return an error or empty result.
    • Authentication failures if the API key or token is missing or invalid.
    • Network connectivity problems preventing access to the backend service.
  • Error messages:

    • "Field not found": Verify the field name is correct and exists within the chosen collection.
    • "Collection not found": Ensure the collection name is valid and accessible.
    • Authentication errors: Check that the API credentials are properly set up in n8n.

Links and References

Discussion