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

# サンプル 4. Step 9: TotalAmount field、SumGroup Group 要素

> 検出された請求書テーブルの下を検索するよう制約された SumGroup element に Total Amount の検索をグループ化し、kwTotal と TotalAmount のサブ要素を含めます。

テスト文書を解析すると、Total Amount field は最終ページのテーブルの下にあり、field 名と一緒にのみ出現することがわかります。さらに、その field 自体は field 名と同じ高さにあるか、その下にあります。field には 1 行しかないため、これを検索するために Character String element を作成します。

field とその名前に共通する設定を指定するには、Group element を使用します。

SumGroup element を作成するには:

1. 型 Group の要素を作成し、**SumGroup** という名前を付けます。
2. Advanced タブをクリックし、Advanced pre-search relations field で、グループ内のすべての要素に対する追加の検索条件を指定します: 最後に検出されたテーブルの下にあるオブジェクトを検索します。この制約は、[FlexiLayout language](/ja/flexi-capture/fls/code/general-code) では次のように記述できます:

   ```text theme={null}
   If not InvoiceTable.LastSubTable.Body.IsNull then
   Below: InvoiceTable.LastSubTable.Body.Rect.Bottom;
   ```

TotalAmount field 内のキーワードを検索するには、型 Static Text の SumGroup.kwTotal element を使用します。詳しい手順については、[Step 9.1](/ja/flexi-capture/fls/tutorial4/4step9-1) を参照してください。

1 行の TotalAmount field を検索するには、型 Character String の SumGroup.TotalAmount element を使用します。詳しい手順については、[Step 9.2](/ja/flexi-capture/fls/tutorial4/4step9-2) を参照してください。
