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

# Sample 3. Step 24: Describe the Country field with a Country element

> Extract the Country field with a Character String element tied to the kwOrigin name, setting alphabet, character count, and offset relations.

Use an element of type [Character String](/flexi-capture/fls/template/character-chain) to detect the Country field. The element sits on the same horizontal level as the field name, and FlexiLayout Studio uses it only when the name is detected.

<Steps>
  <Step title="Create the Character String element">
    In the **Footer** element, create an element of type [Character String](/flexi-capture/fls/template/character-chain) and name it **Country**.
  </Step>

  <Step title="Set the character string properties">
    Click the **Character String** tab and set these properties:

    * Select all Latin characters as the alphabet.
    * Set **Percentage of non-alphabet characters** to 20.
    * In the **Character count** field, specify this fuzzy interval: `[-1, 2, 25, 2147483647]` (2 to 25 characters). Any hypothesis outside this range is penalized.

    Leave the default values for the element's other properties.

    <Frame>
      <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/tutorial3_24.png?fit=max&auto=format&n=r-nfa7jujx5b9gKX&q=85&s=e44b793fce5ac0d81838ee0dc5e6bd72" alt="Screenshot of the Character String tab of the Properties of SearchElements.Footer.Country dialog box in ABBYY FlexiLayout Studio, showing the Latin alphabet character set, Percentage of non-alphabet characters set to 20, and the Country character count fuzzy interval." width="431" height="455" data-path="images/flexi-capture/fls/tutorial3_24.png" />
    </Frame>
  </Step>

  <Step title="Set the position constraints">
    Click the **Relations** tab. The **Country** field appears only to the right of the **kwOrigin** name keywords, no farther than 500 dots from its right boundary, and always on the same level as those keywords, so set these search constraints:

    * **Right of** the **kwOrigin** element, **Offset** = 10
    * **Left of** the **kwOrigin** element, **Offset** = -500, **Reference boundary** = **Right**
    * **Above** the **kwOrigin** element, **Offset** = -10, **Reference boundary** = **Bottom**
    * **Below** the **kwOrigin** element, **Offset** = -10, **Reference boundary** = **Top**

    <Tip>
      When selecting offset values, analyze the geometrical properties (size and boundaries) of the neighboring objects detected during pre-recognition. Otherwise, select these values by trial and error.
    </Tip>
  </Step>

  <Step title="Add the optional-name constraint">
    Click the **Advanced** tab. The **Country** field is optional on this document, but whenever it occurs it always appears next to its name. Set this [additional search constraint](/flexi-capture/fls/template/advanced-constraints) in the **Advanced pre-search relations** field: look for the object only if the **kwOrigin** element was detected. In the [FlexiLayout language](/flexi-capture/fls/code/general-code):

    ```text theme={null}
    If Footer.kwOrigin.IsNull Then DontFind;
    ```
  </Step>

  <Step title="Verify the match">
    Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on every image where it occurs.
  </Step>

  <Step title="Set the block source element">
    To describe the location of the **Country** block, select **Source element**, click <img src="https://mintcdn.com/abbyy/fmgRWFNHKYN2MLSg/images/flexi-capture/fls/Browse_Button.gif?s=3673db30dda4a3293aec716853588b55" alt="Browse button" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="21" height="20" data-path="images/flexi-capture/fls/Browse_Button.gif" />, and select the **Country** element as the source element.
  </Step>
</Steps>
