Skip to main content
Roberty Studio
RPAFunctions

Replace words

Replace words

Replaces every occurrence of one or more words in a text with a new value. Ideal for cleaning data, standardizing formats or correcting information in bulk — such as replacing abbreviations, removing unwanted characters or swapping terms before sending data to another system.


Options​

Original Text​

Enter the text where the replacements will be performed. It can be a fixed value, the return of a previous action or a variable.

Replace with​

Enter the value that will take the place of each occurrence found. If this field is left empty, the words found are simply removed from the text.

Words to be replaced​

Enter the list of words or excerpts that must be located and replaced in the text. Each item of the list is searched for independently.

Returns​

Javascript code​

js
actions["action-id"].value // resulting text after all the replacements (Text)

Field selection​

  • value — text with every occurrence replaced (Text)

Rules and Conditions​

  • The Original Text field is required. If no word is provided in Words to be replaced, the text is returned unchanged.
  • Every occurrence of each word provided is replaced — not only the first one.
  • The replacement is case-sensitive.
  • Leaving the Replace with field empty removes the words found without inserting anything in their place.