Simple Replace
AI-generatedSummary
Replace specified text with another string using simple string replacement, optionally case-sensitive and replacing all occurrences.
Inputs
- operation — The selected operation; for Simple Replace this is always 'simple'.
- inputSource — Source of text to process; can be 'field', 'allFields', or 'custom'.
- fieldName (required) — Name of the input field to process when inputSource is 'field'.
- customText (required) — Direct text or expression to process when inputSource is 'custom'.
- outputFieldName (required) — Name of the output field where the result will be stored.
- findString (required) — Text to find for replacement.
- replaceString (required) — Text to replace matches with; can be empty to delete matches.
- options — Additional options such as case sensitivity, replace all occurrences, include nested fields, and store result in a new field.
Output shape
an array of items with the same structure as the input, where the selected field(s) are replaced according to the configuration
If continueOnFail is enabled, items with errors are returned with an 'error' field; otherwise the operation throws.
Examples
Example 1: Replace all occurrences of 'foo' with 'bar' in the field 'description'
inputSource=field, fieldName=description, findString=foo, replaceString=bar, options={caseSensitive:true, replaceAll:true}
Example 2: Replace a custom string with an expression result and store in a new field
inputSource=custom, customText={{ $json.old }}, outputFieldName=newValue, findString=old, replaceString=new, options={caseSensitive:false}
Example 3: Process all string fields in the input and store result in a new field
inputSource=allFields, options={includeNested:true, outputToNewField:true, newFieldName=replacedText}