> ## 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 2. Step 22: Create a Portions element

> Extract the number of servings with a Portions Character String element whose alphabet, character count, and offsets tie it to the Serves element.

Define the number of servings as a [Character String](/flexi-capture/fls/template/character-chain) element named **Portions**.

<Steps>
  <Step title="Create the Character String element">
    Create an element of type **Character String** and name it **Portions**.
  </Step>

  <Step title="Open the Character String tab">
    Click the **Character String** tab.
  </Step>

  <Step title="Set the alphabet">
    Set the required alphabet. Judging by the test images, the alphabet includes all the digits and the letters `T`, `t`, `O`, and `o`.
  </Step>

  <Step title="Set the percentage of alphabet characters">
    In the **Percentage of alphabet characters** field, enter 1.
  </Step>

  <Step title="Disable embedded hypotheses">
    Clear the **Allow embedded hypotheses** check box.
  </Step>

  <Step title="Set the percentage of non-alphabet characters">
    In the **Percentage of non-alphabet characters** field, set the maximum to 20%.
  </Step>

  <Step title="Set the character count">
    In the **Character count** field, specify this fuzzy range: `{0, 1, 10, 15}`. This estimates the string length, assuming the number of characters is from 1 to 10. Any hypotheses outside this range are penalized.
  </Step>

  <Step title="Open the Relations tab">
    Click the **Relations** tab.
  </Step>

  <Step title="Constrain the horizontal position">
    The number of servings is always to the right of the word `Serves`, and the distance between the right boundary of `Serves` and the right boundary of the number cannot exceed 200 dots.

    Specify these search constraints:

    * **Right of** the **Serves** element, **Offset** = 0
    * **Left of** the **Serves** element, **Offset** = -200, **Reference boundary** = **Right**
  </Step>

  <Step title="Constrain the vertical position">
    The number of servings is always on the same level as the word `Serves`.

    Add these search constraints:

    * **Above** the **Serves** element, **Offset** = -50
    * **Below** the **Serves** element, **Offset** = -50
  </Step>
</Steps>
