Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

The "Preset - Update Multiple" operation in this custom n8n node allows users to update multiple preset records at once in a Directus system. This is particularly useful when you need to apply the same changes (such as updating layout or other properties) to several presets simultaneously, streamlining bulk updates and reducing repetitive manual work.

Practical Example:
Suppose you have several dashboard presets in Directus and want to change their layout from "list" to "tabular". Instead of updating each preset individually, you can use this node to update all relevant presets in one go by specifying their primary keys and the new layout configuration.

Properties

Name Meaning
Data (JSON) JSON object containing:
- keys: Array of primary keys for the presets you wish to update.
- data: An object with any properties of the preset object to update.

Output

  • The output will be a json field containing the result of the update operation. Typically, this includes information about the updated presets, such as their IDs and the new values of the updated fields.
  • No binary data is produced by this operation.

Dependencies

  • Requires access to a Directus instance with appropriate API credentials and permissions to update presets.
  • Any necessary authentication (API key, token, etc.) must be configured in n8n for the Directus node.

Troubleshooting

  • Common Issues:

    • Invalid Keys: If the provided keys do not correspond to existing presets, no updates will occur, or an error may be returned.
    • Malformed JSON: If the "Data (JSON)" property is not valid JSON, the node will throw a parsing error.
    • Insufficient Permissions: If the API credentials lack permission to update presets, the operation will fail.
  • Error Messages:

    • "Invalid JSON input": Ensure your "Data (JSON)" property is correctly formatted.
    • "Permission denied": Check that your API credentials have the correct permissions in Directus.
    • "Preset(s) not found": Verify that the keys array contains valid preset IDs.

Links and References

Discussion