Replace

This is a pre-built Action located under the @Generic Element. The functionality of this Action in Avo Assure is to replace a specified part of the input text with a given replacement text. The updated result is stored in a dynamic variable.

Syntax

Input Value: <actual string>;<string to be replaced>;<string to replace>

Argument
Description

<actual string>

(Required)

Provide the actual string where the replacement should occur.

<string to be replaced>

(Required)

Provide the string that needs to be replaced within the actual string.

<string to be replaced>

(Required)

Provide the new string that will replace the specified text.

Output Value: <Dynamic Variable>;<Dynamic Variable>(Optional)

Argument
Description

<Dynamic Variable >

(Required)

This dynamic variable stores the replaced string.

<Dynamic Variable >

(Optional)

This dynamic variable stores the status as True or False.

Example: Replacing a String with Another String

In this example, we explain how to replace a specific string with another string.

  • Action: Replace

  • Input Value: Michael Brown;Brown;Smith

    • The first argument (Michael Brown) specifies the original string.

    • The second argument (Brown) specifies the word to replace.

    • The third argument (Smith) specifies the new word that will replace the old one.

  • Output Value: {Replaced value}

    • The updated string (Michael Smith) is stored in this {Replaced value} dynamic variable.

    • If the second output variable is defined, it stores the action status with the following possible values:

      • True: If the replacement is successful.

      • False: If the replacement fails due to invalid input or when the specified word to replace is not found.

  • Logical Explanation: The Replace action fetches the value from the Input Value column (Michael Brown;Brown;Smith), replaces the string (Brown) with (Smith), and stores the updated string (Michael Smith) in the {Replaced value} dynamic variable.

Knowledge Bites:

Here are some examples of different string scenarios:

String
Input Value
Result

Text Strings

Blue World;World;Sky

Blue Sky

Numeric Strings

12345;23;98

19845

Special Character

Alphanumeric strings

ID8765;8765;2345

ID2345

Last updated

Was this helpful?