Customje icon

Customje

Custom operations

Overview

This node provides custom text processing operations, including a "Reformat Phone Number" operation that extracts and reformats phone numbers found within a given text. It can optionally add a country prefix to the extracted phone numbers. This is useful for standardizing phone number formats in unstructured text data, such as messages, documents, or user inputs.

Practical examples:

  • Cleaning up phone numbers from customer feedback or chat logs before storing them in a database.
  • Normalizing phone numbers in marketing lists to ensure consistent formatting for SMS campaigns.
  • Extracting and reformatting phone numbers from scanned documents or emails.

Properties

Name Meaning
Text The input text containing phone numbers to be extracted and reformatted.
Add Prefix Whether to add a country prefix to the extracted phone numbers (true or false).

Output

The node outputs a JSON array where each item corresponds to the result of processing one input item. The json output field contains the response from the external API which includes the reformatted phone numbers extracted from the input text.

The exact structure depends on the external API response but generally will include:

  • The list of phone numbers found in the text.
  • Each phone number reformatted according to the specified options (with or without country prefix).

No binary data output is produced by this operation.

Dependencies

  • Requires an active internet connection to call the external API at https://api.customje.com/extract.php.
  • No explicit API key or credential is required for this specific operation based on the code, but other operations in the same node may require credentials.
  • The node uses an internal helper function to make HTTP POST requests to the external service.

Troubleshooting

  • Common issues:

    • Network connectivity problems may cause the API request to fail.
    • If the input text does not contain any recognizable phone numbers, the output may be empty or contain no reformatted numbers.
    • Incorrect boolean value for "Add Prefix" property might lead to unexpected formatting results.
  • Error messages:

    • Errors returned from the external API will be propagated and may include HTTP status codes and error messages.
    • If the operation or resource parameters are incorrect or missing, the node throws errors indicating unknown resource or operation.
    • To resolve errors related to API calls, verify network access and check if the external API endpoint is reachable.

Links and References

Discussion