Actions118
- Item Actions
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Server Actions
- Setting Actions
- User Actions
- Utility Actions
- Webhook Actions
Item → Update
AI-generatedOverview
This node updates an existing item in a specified collection within the Directus system. It is useful for scenarios where you need to modify data records dynamically, such as updating user profiles, content entries, or any other data stored in Directus collections. For example, you can update an article's title and body by specifying the item's unique ID, the collection it belongs to, and the new data in JSON format.
Use Case Examples
- Updating a blog post's title and content in the 'articles' collection by providing the item's ID and the updated JSON data.
- Modifying a user's profile information in the 'users' collection by specifying the user ID and the new data fields.
Properties
| Name | Meaning |
|---|---|
| ID | Unique ID of the item to update in the collection |
| Collection Name | Name of the parent collection where the item exists |
| Data (JSON) | Partial item object in JSON format containing the fields to update |
Output
JSON
id- The unique identifier of the updated itemcollection- The name of the collection where the item was updateddata- The updated item data as a JSON object
Dependencies
- Requires connection to a Directus instance with appropriate API authentication credentials.
Troubleshooting
- Ensure the provided item ID exists in the specified collection; otherwise, the update will fail.
- Verify that the collection name is correct and accessible with the provided credentials.
- Validate the JSON data format to avoid syntax errors or invalid field updates.
- Check API permissions to confirm the user has rights to update items in the target collection.
Links
- Directus API - Update an Item - Official documentation for updating items in Directus collections via API.