Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Item → Create or Update

AI-generated

Overview

This node performs create or update operations on items within a specified collection in a Directus instance. It is useful for scenarios where you need to insert new data or update existing data in a collection, such as managing articles, products, or user data. For example, you can create a new article or update an existing one based on a unique identifier.

Use Case Examples

  1. Creating a new article in a collection named 'articles' with title and body fields.
  2. Updating an existing item in a collection by specifying its unique ID and new data.

Properties

Name Meaning
Return All Determines whether to return all results or limit the number of results returned when performing the upsert operation.
Limit Specifies the maximum number of results to return when 'Return All' is false.
Skip Update Indicates whether to skip the update step if the item(s) already exist.
Collection Name The unique name of the parent collection where the item will be created or updated.
Data (JSON) The partial item object in JSON format representing the data to create or update.
ID fieldname The field name used as the unique identifier for the item object.
Select items to create or update Filters to select specific items in the collection by given conditions for update or create operations.

Output

JSON

  • id - The unique identifier of the created or updated item.
  • data - The data of the created or updated item as returned from the Directus API.

Dependencies

  • Directus API authentication credentials

Troubleshooting

  • Ensure the collection name is correct and exists in the Directus instance to avoid errors.
  • Verify that the ID fieldname matches the unique identifier field in the collection to correctly identify items for update.
  • If 'Skip Update' is enabled, ensure that the filter conditions correctly identify existing items to avoid unintended skips.
  • Check the JSON data format for correctness to prevent API errors during create or update operations.

Links

Discussion