> ## 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 11: Detect the right border of the Delivery Address field with a wgAddressRight element

> Set up a wgAddressRight White Gap element that marks the right border of the Delivery Address field and limits its search area in the FlexiLayout.

To specify the right boundary of the search area of the **DeliveryAddress** element, describe the corresponding vertical white gap.

## Create the wgAddressRight element

<Steps>
  <Step title="Create the White Gap element">
    In the `InvoiceHeader.grAddress` element, create a [White Gap](/flexi-capture/fls/template/white-gap) element and name it **wgAddressRight**.
  </Step>

  <Step title="Set the orientation and width">
    Click the **White Gap** tab. In the **Orientation** group, select **Vertical**. Set **Min width** to 100.

    <Tip>
      Before setting the height or width of a white gap, analyze the geometrical properties (size and boundaries) of the neighboring objects detected during pre-recognition. Values for the noise threshold in the white gap area are selected by trial and error.
    </Tip>
  </Step>

  <Step title="Set the noise thresholds">
    Set **Lower threshold limit** and **Threshold coefficient (%)** to 10. Leave the default values for the element's other parameters.

    <Note>
      The values of **Lower threshold limit**, **Upper threshold limit**, and **Threshold coefficient (%)** are selected by trial and error. For more information, see [White Gap](/flexi-capture/fls/template/white-gap).
    </Note>

    <Frame>
      <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/tutorial3_11.png?fit=max&auto=format&n=r-nfa7jujx5b9gKX&q=85&s=4d5ff0ba54776f51d7a36462bf709795" alt="Screenshot of the White Gap tab of the Properties of SearchElements.InvoiceHeader.grAddress.wgAddressRight dialog box in ABBYY FlexiLayout Studio, showing the Vertical orientation selected with Min width set to 100 and the noise threshold values." width="431" height="455" data-path="images/flexi-capture/fls/tutorial3_11.png" />
    </Frame>
  </Step>

  <Step title="Set the location relation">
    Click the **Relations** tab. The sought white gap can be located only to the right of the **kwDeliveryAddress** name keywords, so set this relation:

    * **Right of** the **kwDeliveryAddress** element, **Offset** = 0
  </Step>

  <Step title="Add the search constraints">
    Click the **Advanced** tab. The **Delivery Address** field is optional, but whenever it occurs it has a name, so look for the white gap only if **kwDeliveryAddress** was detected. The white gap is also adjacent to the **Invoice Number** field, so look for the object nearest to **kwInvoiceNumber**. In the **Advanced pre-search relations** field, set these [additional search constraints](/flexi-capture/fls/template/advanced-constraints). In the [FlexiLayout language](/flexi-capture/fls/code/general-code):

    ```text theme={null}
    If InvoiceHeader.kwDeliveryAddress.IsNull Then DontFind;
    Nearest: InvoiceHeader.kwInvoiceNumber;
    ```

    <Tip>
      You can also set the **Nearest** constraint via the FlexiLayout Studio graphical user interface. Click the **Relations** tab, select **Nearest**, and in the **To** drop-down list select **Element**, and then specify **kwInvoiceNumber** as the **Reference element**.
    </Tip>
  </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 the **Delivery Address** field occurs.
  </Step>
</Steps>
