> ## 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 4. Step 7.4: Name of UnitPrice column, kwUnitPrice element

> Search for the Unit Price column name with a kwUnitPrice Static Text element placed right of kwQuantity and scored with a FuzzyQuality post-search check.

After you analyze the images, you will notice that the name of the **Unit Price** column can be described by the search text `UnitPrice`, `Price`, and `RATE`, and that the name **Unit** appears as `Unit`. To prevent FlexiLayout Studio from detecting the word `Unit` in the name of the **Unit Price** column, first describe **Unit Price**, because it contains unique text, and then use an additional relation to describe **Unit**.

When creating an element to search for the keywords of the **Unit Price** column name, take into account that the **Unit Price** column is always to the right of the **Quantity** column.

## Create the kwUnitPrice element

<Steps>
  <Step title="Create the Static Text element">
    In the **TableHeader** element, create a [Static Text](/flexi-capture/fls/template/static-text) element and name it **kwUnitPrice**.
  </Step>

  <Step title="Enter the search text">
    Click the **Static Text** tab. In the **Search text** field, type `UnitPrice|Price|RATE`.
  </Step>

  <Step title="Add position relations">
    To place this name on the same level as the **Designation** name, click the **Relations** tab and specify the additional constraints described in [Step 7.2](/flexi-capture/fls/tutorial4/4step7-2).
  </Step>

  <Step title="Constrain to the X coordinate">
    On the **Relations** tab, specify this condition: search for an element closest to the X coordinate with value 0.

    <Frame>
      <img src="https://mintcdn.com/abbyy/8aWHPAJyzWmTqglX/images/flexi-capture/fls/tutorial4_7_4.png?fit=max&auto=format&n=8aWHPAJyzWmTqglX&q=85&s=59622c8acb72f508f48830cccd005170" alt="Screenshot of the Relations tab of the kwUnitPrice Static Text element properties in ABBYY FlexiLayout Studio, showing the constraint to search for an element closest to the X coordinate with a value of 0." width="431" height="455" data-path="images/flexi-capture/fls/tutorial4_7_4.png" />
    </Frame>
  </Step>

  <Step title="Add a pre-search condition">
    Because the name of the **Unit Price** column is to the right of the **kwQuantity** column name, click the **Advanced** tab and specify this condition in **Advanced pre-search relations**: if the **kwQuantity** element is detected, search for the image object to the right of it. In the [FlexiLayout language](/flexi-capture/fls/code/general-code):

    ```text theme={null}
    If Not (TableHeader.kwQuantity.IsNull) Then
    RightOf: TableHeader.kwQuantity, 0 * dot;
    ```
  </Step>

  <Step title="Skip the search when Designation is missing">
    To optimize the search, do not search for the name if the **Designation** name is not detected, as described in [Step 7.2](/flexi-capture/fls/tutorial4/4step7-2).
  </Step>

  <Step title="Add post-search relations">
    Influence the quality of the generated hypotheses with an additional check in the **Advanced post-search relations** field: if the element is detected, calculate the difference between the reference width and the width of the detected element, and check whether it belongs to the given fuzzy interval. In the [FlexiLayout language](/flexi-capture/fls/code/general-code):

    ```text theme={null}
    If not IsNull then
    { FuzzyQuality: 400dt - width, {-50000,0,0, 50000}*dt;
    }
    //This check means that the greater the difference, the greater the penalty coefficient
    ```
  </Step>

  <Step title="Match the FlexiLayout">
    Match the FlexiLayout to confirm that the element is detected on the first page of the document.
  </Step>
</Steps>
