> ## 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 3. Step 8: Describe the Invoice Number field with an InvoiceNumber element

> Step 8 of FlexiLayout Studio Sample 3: describe the Invoice Number field with a Character String element, fuzzy character counts, and relation constraints.

The **Invoice Number** field is to the right of its name, on the same horizontal level. On some images the number is poorly recognized, so do not restrict the alphabet. Instead, restrict the search area and restrict the string length to 3-20 characters.

## Create the InvoiceNumber element

<Steps>
  <Step title="Create the Character String element">
    In the **InvoiceHeader** element, create a [Character String](/flexi-capture/fls/template/character-chain) element and name it **InvoiceNumber**.

    <Tip>
      The element and the block that corresponds to the **InvoiceNumber** field need not have identical names, but matching names are handy when working with the FlexiLayout.
    </Tip>
  </Step>

  <Step title="Remove the alphabet restriction">
    Click the **Character String** tab. Set **Percentage of non-alphabet characters** to 100%, which removes any restriction on characters.
  </Step>

  <Step title="Set the character count">
    In the **Character count** field, specify this fuzzy interval: `{-1, 3, 20, INF}`. This restricts the string length; assume 3 to 20 characters. Any hypothesis outside this range is penalized.
  </Step>

  <Step title="Set the search constraints">
    Click the **Relations** tab. **InvoiceNumber** occurs only to the right of the **kwInvoiceNumber** name keywords, no farther than 550 dots from their right boundary, and always on the same level. Set these constraints:

    * **Right of** the **kwInvoiceNumber** element, **Offset** = 0
    * **Left of** the **kwInvoiceNumber** element, **Offset** = -550, **Reference boundary** = **Right**
    * **Above** the **kwInvoiceNumber** element, **Offset** = -10, **Reference boundary** = **Bottom**
    * **Below** the **kwInvoiceNumber** element, **Offset** = -10, **Reference boundary** = **Top**

    <Note>
      Offset values are selected by trial and error.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/abbyy/8aWHPAJyzWmTqglX/images/flexi-capture/fls/tutorial3_8.png?fit=max&auto=format&n=8aWHPAJyzWmTqglX&q=85&s=bafbe00ed0dea10c34560751a7759ee6" alt="Screenshot of the Relations tab of the Properties of SearchElements.InvoiceHeader.InvoiceNumber dialog box in ABBYY FlexiLayout Studio, showing the RightOf, LeftOf, Below, and Above relations to the kwInvoiceNumber element." width="431" height="455" data-path="images/flexi-capture/fls/tutorial3_8.png" />
    </Frame>
  </Step>

  <Step title="Verify the match">
    Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on all the images where applicable.
  </Step>

  <Step title="Set the block source element">
    To describe the location of the **InvoiceNumber** block, open its **Properties**, select **Source element**, click <img src="https://mintcdn.com/abbyy/fmgRWFNHKYN2MLSg/images/flexi-capture/fls/Browse_Button.gif?s=3673db30dda4a3293aec716853588b55" alt="Browse button" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="21" height="20" data-path="images/flexi-capture/fls/Browse_Button.gif" />, and select the **InvoiceNumber** element as the source element.
  </Step>
</Steps>
