Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
Overview
The Directus - Preset: Update operation allows you to update an existing preset in a Directus instance. A "preset" in Directus typically refers to saved user interface configurations, such as default filters, layouts, or sorting for collections and views. This node is useful when you want to programmatically modify how data is presented to users or adjust UI preferences without manual intervention.
Common scenarios:
- Automating the update of view settings for different user roles.
- Rolling out new default layouts or filters across multiple environments.
- Integrating with deployment pipelines to ensure consistent UI presets.
Example:
You have a table view preset for a collection and want to change its layout from "tabular" to "cards" for all users after a product update.
Properties
Name | Type | Meaning |
---|---|---|
Data (JSON) | JSON | A partial preset object. Used to specify which fields of the preset to update (e.g., layout, filters, etc.). |
ID | String | Primary key of the preset. This uniquely identifies which preset will be updated. |
Output
- The output is a single
json
object containing the updated preset's data as returned by the Directus API. - The structure of this object matches the Directus Preset object, including only the fields that were updated or are part of the response.
Example output:
{
"id": 39,
"layout": "tabular",
"collection": "articles",
"role": null,
"user": null,
"filters": [],
"search": "",
"sort": "",
"bookmark": false,
"icon": null,
"color": null,
"translation": null
}
Note: The actual fields depend on your Directus configuration and what was updated.
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure n8n with valid Directus API credentials (
directusApi
). - No additional environment variables are required beyond standard n8n credential setup.
Troubleshooting
Common issues:
- Invalid ID: If the provided ID does not correspond to an existing preset, the node will throw an error like
Preset not found
.- Resolution: Double-check the ID value.
- Malformed Data (JSON): If the "Data (JSON)" property is not valid JSON or does not match the expected structure, you may see errors such as
Unexpected token
orInvalid request body
.- Resolution: Validate your JSON before submitting.
- Insufficient Permissions: If the API credentials do not have permission to update presets, you may receive a
403 Forbidden
or similar error.- Resolution: Ensure the API user has appropriate permissions in Directus.