Skip to main content

Replace Values

Replaces specified values in a data table with new values.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Table - The input data table in which to replace values.
  • Old Value - The value to be replaced.
  • New Value - The value to replace the old value with.

Options

  • Regex - Specifies whether to treat the Old Value as a regular expression. Options are:
    • True - Treat Old Value as a regular expression
    • False - Treat Old Value as a literal value
  • Output Type - Specifies whether to pass the table by reference or by value. Options are:
    • Pass By Reference
    • Pass By Value

Output

  • Table - The resulting data table with values replaced.

How It Works

The Replace Values node replaces specified values in a data table with new values. When executed, the node:

  1. Validates that the input table is not empty and is valid
  2. Checks if the table is a reference table and handles it appropriately
  3. Validates that both Old Value and New Value are provided
  4. Converts the data table to a pandas DataFrame
  5. Replaces all occurrences of the Old Value with the New Value
  6. Converts the modified DataFrame back to the data table format
  7. Returns the updated table

Requirements

  • A valid input data table
  • Valid Old Value and New Value inputs

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid input table
  • Empty Old Value
  • Empty New Value
  • Invalid table structure

Usage Notes

  • The Output Type option can be set to "Pass By Reference" for handling large tables more efficiently
  • When Regex is set to True, the Old Value is treated as a regular expression pattern
  • When Regex is set to False, the Old Value is treated as a literal value
  • The replacement operation affects all columns in the table
  • The node replaces all occurrences of the Old Value with the New Value