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 → Create
AI-generatedOverview
This node creates a new item in a specified collection within the Directus system. It is useful for automating the addition of data entries to a Directus collection, such as adding new articles, products, or records programmatically. For example, it can be used to create a new article with a title and body content in a content management workflow.
Use Case Examples
- Creating a new article in a 'articles' collection with title and body fields.
- Adding a new product entry to a 'products' collection with various attributes.
Properties
| Name | Meaning |
|---|---|
| Collection Name | Specifies the unique name of the parent collection where the new item will be created. This is required to identify the target collection in Directus. |
| Data (JSON) | The partial item object in JSON format representing the data fields and values to be set for the new item. This is required and should conform to the Directus item structure for the target collection. |
Output
JSON
id- The unique identifier of the newly created item in the collection.collection- The name of the collection where the item was created.data- The data object representing the created item with its fields and values.
Dependencies
- Directus API endpoint and authentication credentials are required to perform the create operation.
Troubleshooting
- Ensure the collection name is correct and exists in the Directus instance to avoid errors.
- Validate the JSON data structure to match the collection's schema to prevent validation errors.
- Authentication errors may occur if API credentials are missing or invalid; verify credentials are properly configured.
Links
- Directus API - Create an Item - Official documentation for creating an item in a Directus collection via API.