> This page is for version Scripted.
> For other versions, use one of these documentation indexes:
> - Generative (default): https://developers.ada.cx/generative/llms.txt
> - Scripted: https://developers.ada.cx/scripted/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.ada.cx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.ada.cx/_mcp/server.

# Search for and replace text using the Answer Utilities block

## Overview\[#UUID-c473645b-3be0-0a8b-43d5-7c0628224625_id_1500011227422_id_h_01F609M7BC4TTP9R7D03D628D2]

The Search & Replace action does exactly what its name suggests; it
searches a body of text for a specific item, such as a term or a phrase,
and replaces it with new text! Setup is quick and easy. You can define a
static bit of text or use a variable to allow for text that can be
updated depending on the scenario.

![](/_fern-files/developers.ada.cx/33045f0fa82bde82a5f443961663235c7381fefe60bfd65a8bc69b22654bd22a/ada.docs.buildwithfern.com/2025-05-28T19:49:52.708Z/versions/assets/image/uuid-8bd484b9-bcff-e1ed-5052-7805eae82375.gif)

## Configure the Search & Replace action\[#UUID-c473645b-3be0-0a8b-43d5-7c0628224625_id_1500011227422_id_h_01F609ME81GET9TPPACWK43GWR]

To configure the Search & Replace action, you need to provide the body
of content that contains the text that is to be updated, the text to be
updated, and optionally the replacement text for the text that is to be
updated.

There are two mandatory fields to complete, plus one optional field.

<table>
  <tbody>
    <tr>
      <td>
        **Input Text**
      </td>

      <td>
        The content to search within for the specified Search
        Text.
      </td>
    </tr>

    <tr>
      <td>
        **Search Text**
      </td>

      <td>
        The text to search for within the Input Text.
      </td>
    </tr>

    <tr>
      <td>
        **Replacement Text** (optional)
      </td>

      <td>
        The text that replaces the Search Text within the Input Text.

        > **Note**
        >
        > Omit this option if you wish to remove the Search Text from the Input
        > Text.
      </td>
    </tr>
  </tbody>
</table>

### Setup steps

1. Drag the Answer Utilities Block from the block drawer and drop it
   into the Answer workspace.

2. Click the **Select an action** drop-down and select **Search &
   Replace**. The block updates with new fields relevant to this
   utility.

3. Add a variable to the **Input Text** field containing the content to
   search within.

4. Add the search term or phrase you wish to search for to the **Search
   Text** field. Use a variable to allow for updating the search text
   dynamically.

5. \[Optional] Click the Select Optional Inputs drop-down, then select
   **Replacement Text.**

6. \[Optional] Update the Replacement Text field with the content that
   is to replace the Search Text.

7. Click the **Select Optional Variables** drop-down menu, then select
   **Formatted Text**.

8. Select an existing variable for saving the updated Input Text, or
   create a new variable.

9. Click the **Fallback Answer** drop-down menu, then select a fallback
   Answer to surface should an error occur.

10. Click **Save**.

![](/_fern-files/_img/cb17fbd50b8868aa0391582f995f40912dd9b36ac3aa73d29e3674325b64afdb.webp)

---

Have any questions? Contact your Ada team, or email us at [](<mailto:help@ada.support%20%E2%80%9CHelp Docs inquiry%E2%80%9D>).