Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
This node integrates with the Directus API to manage fields within collections. Specifically, the "Fields" resource with the "Delete" operation allows users to delete a field from a specified collection in Directus. This is useful when you want to programmatically remove unwanted or obsolete fields from your data schema.
Common scenarios include:
- Cleaning up a collection by removing deprecated fields.
- Automating schema changes as part of a deployment or migration process.
- Managing dynamic schemas where fields need to be added or removed based on business logic.
Example: You have a collection named "articles" and want to delete the field "summary" because it is no longer needed. Using this node, you specify the collection "articles" and select the "summary" field to delete it via the Directus API.
Properties
| Name | Meaning |
|---|---|
| Collection | The name of the collection from which the field will be deleted. Example: "articles". |
| Field | The unique name of the field to delete within the specified collection. |
The "Field" property options are dynamically loaded based on the selected collection, ensuring only valid fields can be chosen.
Output
The output JSON contains the response from the Directus API after attempting to delete the specified field. Typically, this will be an object indicating success or failure of the deletion request.
Example output structure (simplified):
{
"json": {
"data": { /* details about the deleted field or confirmation */ }
}
}
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoints for fields management.
- Proper permissions in Directus are necessary to delete fields in collections.
Troubleshooting
- Permission errors: If the API returns authorization errors, ensure the API key has sufficient rights to modify the collection schema.
- Field not found: Selecting a field that does not exist in the collection will cause an error. Use the dynamic loading feature to pick valid fields.
- Collection not found: Ensure the collection name is correct and exists in the Directus instance.
- API connectivity issues: Verify network access to the Directus API endpoint and that credentials are valid.
- Continue on Fail: If enabled, errors will be returned in the output JSON instead of stopping execution.