> ## 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 13: Describe the field that contains the name of the recipe

> Locate the recipe name field with a RecipeName Character String element, combining NearestY constraints with excluded regions to narrow the search area.

Describe the recipe name field as the object closest to the bottom boundary of the form's heading, but exclude the regions that contain the **Recipe** and **RecipeNumber** elements. For more information, see [Step 8](/flexi-capture/fls/tutorial2/2step8).

This takes two tasks: create a **RecipeName** [Character String](/flexi-capture/fls/template/character-chain) element for the recipe name, and then create a **RecipeName** block for the field.

<Steps>
  <Step title="Create the Character String element">
    Create a **Character String** element and name it **RecipeName**. It corresponds to the recipe name.
  </Step>

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

  <Step title="Set the alphabet">
    Set the required alphabet. In the test images, it includes all the letters of the English alphabet, digits, and the characters `#`, `-`, `&`, and `.`. The order and number of characters are not known in advance.
  </Step>

  <Step title="Set the percentage of alphabet characters">
    Set **Percentage of alphabet characters** to 1.
  </Step>

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

  <Step title="Set the percentage of non-alphabet characters">
    Set **Percentage of non-alphabet characters** to 0.2 (that is, 20%).
  </Step>

  <Step title="Set the character count">
    In the **Character count** field, specify the fuzzy range that estimates the total length of all the character strings. Keep the default range of `{-1, -1, INF, INF}`, which means there are no constraints on the length of the character string.
  </Step>

  <Step title="Set the vertical search constraint">
    Click the **Relations** tab.

    Tell FlexiLayout Studio that the recipe name is at least 100 dots lower than the bottom boundary of the form's heading. In other words, there must be a gap at least 100 dots wide between the heading and the recipe name.

    Every line below the heading meets this criterion, so the search area must be narrowed further.
  </Step>

  <Step title="Narrow the search to the closest line">
    Click the **Advanced** tab.

    In the **Advanced pre-search relations** field, specify an [additional search constraint](/flexi-capture/fls/template/advanced-constraints): look for the line closest to the top boundary of the document. In the [FlexiLayout language](/flexi-capture/fls/code/general-code), write it as follows:

    ```text theme={null}
    NearestY: 0*dot;
    ```

    Together with the search constraint on the **Relations** tab, this narrows the search area to the one line closest to the document heading.

    <Tip>
      You can also specify this constraint via the graphical user interface. Click the **Relations** tab, select **Nearest**, and in the **To** drop-down list select **Page top edge**.
    </Tip>

    <Frame>
      <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/tutorial2_17.png?fit=max&auto=format&n=r-nfa7jujx5b9gKX&q=85&s=fc1e0cd1e23b82a1590a55493cb74fe9" alt="Screenshot of the Relations tab of the Properties of SearchElements.RecipeName dialog box in ABBYY FlexiLayout Studio, showing a Below relation to FormHeader and the Nearest option set to Page top edge." width="427" height="454" data-path="images/flexi-capture/fls/tutorial2_17.png" />
    </Frame>
  </Step>

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

  <Step title="Exclude the Recipe and RecipeNumber regions">
    As stated in [Step 8](/flexi-capture/fls/tutorial2/2step8), exclude the regions of the **Recipe** and **RecipeNumber** elements from the search area for **RecipeName**.

    Click the **Add...** button next to the **Exclude regions of elements** field, and then in the **Select Element to Exclude** dialog box select the **Recipe** and **RecipeNumber** elements.

    <Frame>
      <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/tutorial2_18.png?fit=max&auto=format&n=r-nfa7jujx5b9gKX&q=85&s=36f01df4710bea424fc15f679aec4cd7" alt="Screenshot of the Search Constraints tab of the Properties of SearchElements.RecipeName dialog box in ABBYY FlexiLayout Studio, showing SearchElements.Recipe and SearchElements.RecipeNumber listed under Exclude regions of elements." width="427" height="454" data-path="images/flexi-capture/fls/tutorial2_18.png" />
    </Frame>
  </Step>
</Steps>

Match the FlexiLayout against the test images and confirm that FlexiLayout Studio finds the recipe name field on every image.

## Create the RecipeName block

Create the **RecipeName** block the same way as the **RecipeNumber** block. The only difference is that you must specify the **RecipeName** element as the source element for the **RecipeName** block.
