The REPLACE() function replaces part of a string based on a position and length. It is useful for modifying a specific segment of text.
Text function name:
REPLACE()
Syntax
REPLACE(text, starting_position, number_of_characters, new_text)ℹ Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to be added between quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
text |
Text in which to perform the replacement. |
starting_position |
Starting position for replacement (first character = 1). |
number_of_characters |
Number of characters to replace. |
new_text |
Replacement text inserted from starting_position. |
Example
REPLACE("TimeTonic", 1, 4, "Demo")Result: "DemoTonic"
Notes
If
starting_positionexceeds the length of the string, no replacement is performed.If
number_of_charactersis zero, the text is inserted without deletion.
Return type
The function returns text.
The output type format of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula column article.
Business use case
REPLACE() is particularly useful for cleaning up data entered by users or imported from external sources (API, CSV, forms).
Best practice
Before any automation or comparison, it is recommended to normalize data (spaces, special characters, separators) using REPLACE(), SUBSTITUTE(), TRIM(), or UPPER().