> ## 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: Describing 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 field Invoice Number is to the right of the name and is located on the same horizontal level. Analysis of the test images reveals that on some of the images the number has been poorly recognized. So do not restrict the alphabet. Instead, restrict the search area and restrict the length of the string to 3-20 characters.

To create the InvoiceNumber element:

1. In the **InvoiceHeader** element, create an element of type [Character String](/flexi-capture/fls/template/character-chain) and name it **InvoiceNumber**.

   <Tip>
     The element and the block which corresponds to the field **InvoiceNumber** need not have identical names, but this is handy when working with the FlexiLayout.
   </Tip>

2. Click the Character String tab.

3. Set the Percentage of non-alphabet characters to 100%, which means that there is no restriction for characters.

4. In the Character count field, specify this fuzzy interval: `{-1, 3, 20, INF}`, which restricts the number of characters in the string. Assume that the possible values range from 3 to 20. Any hypotheses outside this range will be penalized.

5. Click the Relations tab.

6. Since **InvoiceNumber** can only occur to the right of the keywords of the name **kwInvoiceNumber**, but no farther than 550 dots from the right boundary of the name **kwInvoiceNumber**, set the following search constraints:

   * Right of the element **kwInvoiceNumber**, Offset = 0
   * Left of the element **kwInvoiceNumber**, Offset = -550, Reference boundary = Right

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

7. Since **InvoiceNumber** is always located on the same level as the keyword of the name **kwInvoiceNumber**, set the following search constraints:

   * Above the element **kwInvoiceNumber**, Offset = -10, Reference boundary = Bottom
   * Below the element **kwInvoiceNumber**, Offset = -10, Reference boundary = Top

   <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>

8. Try matching the FlexiLayout with the test images and make sure that the program successfully detects the element on all the images where applicable.

9. To describe the location of the **InvoiceNumber** block, click its Properties and select the Source element option, and then 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.
