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

# サンプル 3. Step 12: DeliveryAddress 要素を使用した Delivery Address field の記述

> 複数行の Delivery Address field を DeliveryAddress Paragraph 要素で抽出し、近くのキーワードおよびホワイトギャップとのリレーションを適用します。

DeliveryAddress 要素を作成するには:

1. `InvoiceHeader.grAddress` 要素内に、型 [Paragraph](/ja/flexi-capture/fls/template/text-chain) の要素を作成し、**DeliveryAddress** という名前を付けます。

2. Relations タブをクリックします。

3. **DeliveryAddress** field は、名前 **kwInvoiceNumber** より上、**wgAddressRight** のホワイトギャップより左、かつ名前 **kwDeliveryAddress** の先頭より右 (オフセットは小さめ) にのみ存在できるため、次の検索制約を設定します:

   * 要素 **kwInvoiceNumber** より Above、Offset = 0。
   * 要素 **kwInvoiceNumber** より Left of、Offset = 0。
   * 要素 **kwDeliveryAddress** より Right of、Offset = -50、Reference boundary = Left

   <Note>
     Offset 値は試行錯誤で決定します。
   </Note>

4. [Group](/ja/flexi-capture/fls/template/elements-compound) 要素 `InvoiceHeader.grAddress` では、**DeliveryAddress** field は名前 **kwDeliveryAddress** のキーワードより下にのみ配置できることをすでに指定しているため、この制約をここで重ねて指定する必要はありません。

5. Advanced タブをクリックします。

6. **Delivery Address** field は画像上では任意ですが、存在する場合は必ず名前があるため、Advanced pre-search relations field に次の [additional search constraint](/ja/flexi-capture/fls/template/advanced-constraints) を設定します: **kwDeliveryAddress** 要素が検出されている場合にのみオブジェクトを検索します。[FlexiLayout language](/ja/flexi-capture/fls/code/general-code) では:
   `If InvoiceHeader.kwDeliveryAddress.IsNull Then DontFind;`

7. テスト画像で FlexiLayout のマッチングを実行し、該当するすべての画像でプログラムが要素を正しく検出することを確認します。

8. **DeliveryAddress** block の位置を記述するには、Source element オプションを選択し、<img src="https://mintcdn.com/abbyy/fmgRWFNHKYN2MLSg/images/flexi-capture/fls/Browse_Button.gif?s=3673db30dda4a3293aec716853588b55" alt="参照ボタン" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="21" height="20" data-path="images/flexi-capture/fls/Browse_Button.gif" /> をクリックして、ソース要素として **DeliveryAddress** 要素を選択します。
