replace function. String.(Power Automate Cloud flows)

02/07/2024

Japanese version.

Searches for text and replaces the text if a match is found.
This function is similar to the SUBSTITUTE function in Excel.

Spec

replace('<text>', '<oldText>', '<newText>')
ArgumentDefaultDescription
textRequired fieldOriginal text.
oldTextRequired fieldPartial text before substitution.
newTextRequired fieldPartial text after substitution.

How to use

This function is used for text parameters.

In many cases, it is used to initialize or set variables of type "String".

Clicking on replace in the "Expression" tab sets the function name and () in the formula field.

If you see something like the following, your settings are complete.

You can change the contents of the function by clicking on the purple icon.

When dynamic content or variables are used in expressions, special specifications are required.

(How to get dynamic content with expressions.)

Examples of arguments and results

For example, replace('ABCDE','BCD','bcd') will result in "AbcdE".

---

Links

String Functions(Power Automate Cloud flows)