> ## 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.5: Name of Total column, kwTotal element

> Pinpoint the Total column name with a kwTotal Static Text element searched to the right of kwUnitPrice and nearest to a given X coordinate on the page.

You will notice that the **Total** column on all the images is to the right of the **Unit Price** column, so you can search for the **Total** column relative to the **Unit Price** column.

## Create the kwTotal 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 **kwTotal**.
  </Step>

  <Step title="Enter the search text">
    Click the **Static Text** tab. In the **Search text** field, type `TotalChf|Total|Extension|AMOUNT|PRODUCTTOTAL`.
  </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 6000.

    <Frame>
      <img src="https://mintcdn.com/abbyy/8aWHPAJyzWmTqglX/images/flexi-capture/fls/tutorial4_7_5.png?fit=max&auto=format&n=8aWHPAJyzWmTqglX&q=85&s=1e36871f458717e0cfc2021e00c78936" alt="Screenshot of the Relations tab of the kwTotal 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 6000." width="431" height="455" data-path="images/flexi-capture/fls/tutorial4_7_5.png" />
    </Frame>
  </Step>

  <Step title="Add a pre-search condition">
    Because the name of the **Total** column is to the right of the **kwUnitPrice** column name (when it is present on the image), click the **Advanced** tab and specify this condition in **Advanced pre-search relations**: if the **kwUnitPrice** 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.kwUnitPrice.IsNull) Then
    RightOf: TableHeader.kwUnitPrice, 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="Match the FlexiLayout">
    Match the FlexiLayout to confirm that the element is detected on the first page of the document.
  </Step>
</Steps>
