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
The node integrates with the Directus API to perform various operations on different resources. Specifically, for the Items resource and the Update Multiple operation, it allows users to update multiple items within a specified collection in bulk. This is useful when you need to modify several records at once without making individual update calls for each item.
Typical use cases include:
- Bulk updating the status or category of multiple articles in a content management system.
- Changing multiple user attributes simultaneously.
- Applying batch modifications to inventory items in an e-commerce database.
For example, you might update the "status" field to "published" for items with IDs 1 and 2 in the "articles" collection.
Properties
| Name | Meaning |
|---|---|
| Collection | The unique name of the parent collection where the items reside. Example: articles. |
| Data (JSON) | JSON object containing the keys (item IDs) to update and the partial item data to apply. For example:json<br>{<br> "keys": [1, 2],<br> "data": {<br> "status": "published"<br> }<br>}<br> |
Output
The output is a JSON object representing the response from the Directus API after attempting to update the specified items. It typically contains information about the updated items or the result of the bulk update operation.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to a Directus instance via an API key credential.
- The node uses the Directus REST API endpoints to perform operations.
- Proper permissions must be granted to the API key to update items in the specified collection.
Troubleshooting
- Invalid Collection Name: If the collection name does not exist or is misspelled, the API will return an error. Verify the collection name is correct.
- Malformed JSON Data: The
Data (JSON)property must be valid JSON. Errors in parsing will cause failures. Use proper JSON formatting. - Insufficient Permissions: The API key used must have update permissions on the target collection; otherwise, the request will fail.
- Empty Keys Array: Ensure that the
keysarray in the data JSON is not empty; otherwise, no items will be updated. - API Rate Limits or Network Issues: Network connectivity problems or API rate limits may cause errors. Retry or check network/API status.
Common error messages usually come directly from the Directus API and indicate issues such as authentication failure, invalid parameters, or permission denials.