> ## 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 6.3: The final part of the document, LongFooter element

> Describe the LongFooter Static Text element that detects the TOTALAMOUNTMUST, Carriedover, and TotalCHF keywords marking the final part of the invoice.

## Create the LongFooter element

<Steps>
  <Step title="Add the Static Text element">
    In the **InvoiceFooter** element, create an optional element of type **Static Text** and name it **LongFooter**.
  </Step>

  <Step title="Enter the search text">
    On the **Static Text** tab, in the **Search text** field, type `TOTALAMOUNTMUST|Carriedover|TotalCHF`.
  </Step>

  <Step title="Add a position relation">
    Because the search text is always located under the name of the **Description** column, click the **Relations** tab and specify this relation:

    * Below the **AddTag** element, **Offset** = 100.
  </Step>

  <Step title="Constrain the search to the topmost text">
    On some documents (for example, documents 3 and 9), FlexiLayout Studio finds several text variants and selects the wrong one, so you must impose additional constraints. After you analyze the images, you will notice that the text of interest is the topmost text in the search area, closest to the table, so it can serve as the table's **Footer**.

    On the **Relations** tab, specify an additional search constraint that finds the string closest to the upper boundary of the document:

    * Select the **Nearest** option.
    * In the **To** field, select **Y coordinate** from the drop-down list.
    * In the **Y** field, type **0**.

    <Frame>
      <img src="https://mintcdn.com/abbyy/8aWHPAJyzWmTqglX/images/flexi-capture/fls/tutorial4_6_3.png?fit=max&auto=format&n=8aWHPAJyzWmTqglX&q=85&s=923827716c4db265d3f88e07a7d3d8c6" alt="Screenshot of the Relations tab of the LongFooter Static Text element properties in ABBYY FlexiLayout Studio, showing the Nearest option set to the Y coordinate with a value of 0 so the topmost matching text is selected." width="431" height="455" data-path="images/flexi-capture/fls/tutorial4_6_3.png" />
    </Frame>
  </Step>
</Steps>
