> ## 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 14: Describe the Ingredients field

> Capture the Ingredients field by grouping an IngredientsHeader, a horizontal Separator, and a Paragraph element inside a RecipeContents Group element.

Judging by the test images, the ingredients list is a text fragment that is always located below the **Ingredients** field name but above the separator over the **Cooking** field name.

To make these elements easier to describe and to limit the number of possible hypotheses, group them into a [Group](/flexi-capture/fls/template/elements-compound) element.

<Steps>
  <Step title="Create the RecipeContents Group element">
    Create a [Group](/flexi-capture/fls/template/elements-compound) element and name it **RecipeContents**.
  </Step>

  <Step title="Add the IngredientsHeader element">
    Within the **RecipeContents** element, create a **Static Text** element and name it **IngredientsHeader**. It corresponds to the name **Ingredients**. Specify the element's properties as in [Step 10](/flexi-capture/fls/tutorial2/2step10) for the **Recipe** element.
  </Step>

  <Step title="Add the Separator element">
    Within the **RecipeContents** element, create a [Separator](/flexi-capture/fls/template/separator) element for the separator above the name **Cooking**.

    1. On the **Separator** tab, set the separator orientation to **Horizontal**.
    2. In the element's **Properties** dialog box, click the **Relations** tab and set the search constraint below the name **Ingredients:** (that is, **Below** the **IngredientsHeader** element).

    If you match the FlexiLayout, FlexiLayout Studio sometimes treats the lower boundary of an image as a separator. To solve this, add another search constraint.

    In the **Advanced pre-search relations** field (**Properties** dialog box, **Advanced** tab), add this constraint: look for the separator closest to the name **Ingredients:**. In the [FlexiLayout language](/flexi-capture/fls/code/general-code), write it as follows:

    ```text theme={null}
    Nearest: SearchElements.RecipeContents.IngredientsHeader;
    ```

    <Tip>
      You can also specify this constraint via the graphical user interface. Click the **Relations** tab, select **Nearest**, in the **To** drop-down list select **Element**, and then specify **IngredientsHeader** as the **Reference element**.
    </Tip>
  </Step>

  <Step title="Match the adjusted FlexiLayout">
    Match the adjusted FlexiLayout again.

    <Frame>
      <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/tutorial2_19.png?fit=max&auto=format&n=r-nfa7jujx5b9gKX&q=85&s=10c5bbb2b5ae8ccdd5861207fe8c0f05" alt="Screenshot of the ABBYY FlexiLayout Studio editor showing a matched recipe document with the IngredientsHeader element drawn around the Ingredients heading and the Separator hypothesis shown in the Tree of Hypotheses." width="540" height="428" data-path="images/flexi-capture/fls/tutorial2_19.png" />
    </Frame>
  </Step>

  <Step title="Constrain IngredientsHeader to the upper part of the page">
    Add another search constraint for the **IngredientsHeader** element. In the **Advanced pre-search relations** field (**Properties** dialog box, **Advanced** tab), add this constraint: look for the field name in the upper part of the image. In the [FlexiLayout language](/flexi-capture/fls/code/general-code), write it as follows:

    ```text theme={null}
    Above: PageRect.top + PageRect.Height/2;
    ```
  </Step>

  <Step title="Add the Ingredients Paragraph element">
    Within the **RecipeContents** element, create a [Paragraph](/flexi-capture/fls/template/text-chain) element and name it **Ingredients**. It corresponds to the **Ingredients** field.

    On the **Relations** tab of the element's **Properties** dialog box, set the search constraints: below the **Ingredients:** heading (**Below** the **IngredientsHeader**) but above the separator (**Above** the **Separator** element).

    Match the FlexiLayout against the test images and confirm that FlexiLayout Studio finds the **Ingredients** field on every image.
  </Step>
</Steps>

## Create the Ingredients block

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