> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Characters

> Count the characters in a customer response in ChatbotX and use the result to validate a Flow step.

**Count Characters** counts the number of characters in a text value. Use it when a Flow needs to check whether a customer entered enough information before continuing.

For example, you can ask a customer to enter an order code, then check its length before the Flow sends the next message.

## Add Count Characters to a Flow

<Steps>
  <Step title="Open the Flow">
    Open the Flow that collects or uses the text value.
  </Step>

  <Step title="Add a Perform Action node">
    Add a **Perform Action** node after the Flow receives the customer's response.
  </Step>

  <Step title="Choose Count Characters">
    Open the node, click **Create**, then select **Tools > Count Characters**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/GMkdbZ1eGBhC4VPX/images/select_count_characters_in_tools_menu.png?fit=max&auto=format&n=GMkdbZ1eGBhC4VPX&q=85&s=f95168eb53e1934a8b06e778b94c64d5" alt="Select Count Characters In Tools Menu" width="2862" height="1885" data-path="images/select_count_characters_in_tools_menu.png" />
    </Frame>
  </Step>

  <Step title="Choose the text to count">
    Select the **Input Custom Field** that contains the text. Under **Save result to a custom field**, choose the Custom Field that will receive the character count, then click **Save**.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/chatbotx/GMkdbZ1eGBhC4VPX/images/count_characters_action.png?fit=max&auto=format&n=GMkdbZ1eGBhC4VPX&q=85&s=53b47fe44a7682923ec2f5efeaf6363e" alt="Count Characters Action" width="2862" height="1889" data-path="images/count_characters_action.png" />
</Frame>

## Example: validate an order code

Ask the customer to enter an eight-character order code. After the reply is saved, **Count Characters** counts the response. A Condition can then route an eight-character value forward and ask for the code again when the count does not match.

<Note>
  Count Characters measures every character in the selected text, including spaces. Tell customers whether they should enter spaces in a code or reference number.
</Note>
