K
Docs
API ReferencePiecesReplace Text
🔄

Replace Text

base.text.replaceBase SetUtility

Replaces every occurrence of a find string with another value. Handy for sanitizing input, swapping placeholders, or cleaning up user text.

On the canvas

This is what Replace Text looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🔄
Replace Text
base.text.replace
Utility
textrequired
{{message.content}}
findrequired
badword
replace
***
asrequired
cleaned

Config fields

FieldTypeReqWhat it does
text
{{message.content}}
textyesSource text 📝
find
badword
textyesFind
replace
***
textReplace with
as
cleaned
textyesSave as ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{replaced}}stringText after replace

Output ports

outputUpdated text spark is ready
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const cleaned = text.replaceAll("badword", "***");
// {{cleaned}}