Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Attribute → Create Multiple

AI-generated

Overview

This node interacts with the Appwrite API to create multiple attributes within a specified database collection. It supports two input modes: a user-friendly form for adding attributes one by one, or a JSON array for bulk attribute creation. This is useful for automating the setup of database schemas or dynamically managing attribute definitions in Appwrite databases.

Use Case Examples

  1. Creating multiple attributes for a user profile collection by specifying each attribute's type, key, size, and other properties via the form input mode.
  2. Providing a JSON array of attribute definitions to quickly create multiple attributes in a collection, such as for product specifications or metadata.

Properties

Name Meaning
Database ID The ID of the database where attributes will be created.
Collection ID The ID of the collection within the database where attributes will be added.
Input Mode Determines how attributes are provided: either through a form interface or as a JSON array.
Attributes A collection of attribute definitions entered via the form, each specifying type, key, size, required flag, default value, array flag, enum elements, and min/max values as applicable.
Attributes (JSON) An array of attribute objects provided as JSON to create multiple attributes in bulk.

Output

JSON

  • json - The response from the Appwrite API after creating the attributes, typically including details of the created attributes or any errors.

Dependencies

  • Appwrite API with credentials including endpoint, project ID, and API key.

Troubleshooting

  • Ensure the provided databaseId and collectionId are correct and exist in the Appwrite project to avoid 'Unknown resource' or 'Not found' errors.
  • Validate JSON input format when using JSON input mode to prevent parsing errors.
  • Check API key permissions to ensure the node has rights to create attributes in the specified database and collection.
  • If the node throws errors related to attribute properties, verify that required fields like 'key' and 'type' are correctly set and that values like 'size', 'min', and 'max' are valid for the attribute type.

Links

Discussion