Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Item → Update

AI-generated

Overview

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

  1. Updating a blog post's title and content in the 'articles' collection by providing the item's ID and the updated JSON data.
  2. 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 item
  • collection - The name of the collection where the item was updated
  • data - 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

Discussion