0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Text → Compare Strings

AI-generated

Overview

The node provides a utility to compare two text strings using a specified algorithm. It is useful in scenarios where you need to determine the similarity or difference between two pieces of text, such as validating user input against a reference string, detecting duplicates, or performing fuzzy matching in data processing workflows.

For example, you might use this node to:

  • Check if two product descriptions are similar.
  • Compare user-submitted answers with correct answers allowing for minor differences.
  • Detect near-duplicate entries in a dataset.

Properties

Name Meaning
First String The first string to compare.
Second String The second string to compare.
Algorithm The algorithm used to compare the strings. This could be various string comparison methods (e.g., Levenshtein distance, Jaro-Winkler), depending on what the underlying service supports.

Output

The output contains a JSON object with the result of the string comparison. Typically, this will include a similarity score or a boolean indicating whether the strings match according to the chosen algorithm. The exact structure depends on the external API response but generally includes fields representing the comparison metric.

No binary data output is expected from this operation.

Dependencies

  • Requires an API key credential for authentication with the external "0CodeKit" service.
  • The node sends a POST request to the endpoint /text/comparestring on the base URL https://prod.0codekit.com.
  • Proper configuration of the API key credential in n8n is necessary for successful execution.

Troubleshooting

  • Common issues:

    • Missing or invalid API key credential will cause authentication errors.
    • Providing empty strings for either input may lead to unexpected results or errors.
    • Using an unsupported or misspelled algorithm name might cause the API to reject the request.
  • Error messages:

    • Authentication failures typically indicate problems with the API key setup.
    • Validation errors may occur if required properties are missing or empty.
    • API errors related to the algorithm parameter suggest checking the allowed values and spelling.

To resolve these issues, ensure that:

  • The API key credential is correctly configured and active.
  • Both strings are provided and non-empty.
  • The algorithm parameter matches one of the supported algorithms by the external service.

Links and References

Discussion