Appwrite Helper icon

Appwrite Helper

Utility node for building Appwrite queries, permissions, and schemas

Overview

The node is a utility tool designed to generate unique IDs in various formats. It supports generating standard UUID v4, URL-friendly Nanoid, timestamp-based IDs, slugs from text, short alphanumeric IDs, and custom pattern-based IDs. This node is useful in scenarios where unique identifiers are needed for database entries, document names, user sessions, or any system requiring unique keys. For example, it can generate a UUID for a new user record, create a slug from a document title for URLs, or produce a custom patterned ID for tracking purposes.

Use Case Examples

  1. Generating a UUID v4 for a new database record.
  2. Creating a URL-friendly slug from a document title for SEO-friendly URLs.
  3. Producing a short alphanumeric ID for session tokens.
  4. Generating a timestamp-based ID for event logging.

Properties

Name Meaning
ID Format Specifies the format of the generated ID, such as UUID v4, Nanoid, Timestamp, Slug, Short ID, or a Custom Pattern.
Length Defines the length of the generated ID when using Nanoid or Short ID formats. Minimum is 1 and maximum is 36.
Text to Slugify The text input that will be converted into a URL-friendly slug when the Slug format is selected.
Custom Pattern A custom pattern string where 'X' characters are replaced with random digits to form the ID when the Custom Pattern format is selected.

Output

JSON

  • id - The generated unique identifier string based on the selected format and parameters.

Troubleshooting

  • If the node throws an error related to invalid parameters, ensure that the ID format and associated properties (like length, text, or pattern) are correctly set according to the selected format.
  • For custom patterns, ensure the pattern contains 'X' characters as placeholders; otherwise, the ID generation may fail or produce unexpected results.
  • If the slug text is empty when using the Slug format, the output may be an empty string or invalid slug.

Discussion