Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node provides a utility operation to generate a random string of a specified length. This can be useful in scenarios where you need unique identifiers, tokens, or any random alphanumeric strings for testing, temporary passwords, or keys.

For example, you might use this node to create a random password of 20 characters or generate a unique token to track user sessions.

Properties

Name Meaning
Additional Fields Collection of optional settings
Length Length of the random string (minimum 1)

The only configurable property is the "Length" under "Additional Fields," which determines how many characters long the generated random string will be.

Output

The output contains a JSON field with the generated random string. The exact structure isn't detailed in the provided code, but typically it would be something like:

{
  "randomString": "generated_string_here"
}

No binary data output is indicated.

Dependencies

  • No external services or API keys are required.
  • The functionality appears self-contained within the node's codebase.

Troubleshooting

  • If the "Length" property is not set or set to an invalid value (e.g., less than 1), the node may throw an error or produce unexpected results. Ensure the length is a positive integer.
  • Since the source code references a router and methods from other modules, missing or corrupted dependencies could cause execution failures.
  • Make sure the node is properly configured with the correct resource ("utils") and operation ("getRandomString") to access this functionality.

Links and References

Discussion