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

# エクスポート設定とフィールドマッピングの指定

> Appian コネクタのエクスポートフィールドに関するリファレンス: server、repository、FileName タグ、NameConflictResolution、および FlexiCapture から Appian へのフィールドマッピング。

このセクションでは、**ExportScript - Appian - Configure by script.cs** スクリプトおよび **default.config.xml** 設定ファイルのフィールドについて説明します。

**Server** には、Appian サーバーのアドレスと接続に使用するポートを指定します (デフォルトのポートは 8080) 。例：\<Server>[http://computername.domain.com:8080\&lt;/Server\&gt;。](http://computername.domain.com:8080\&lt;/Server\&gt;。)

**Username** には、Appian のユーザー名が含まれます。例：\<Username>username\</Username>。

**Password** にはユーザーのパスワードが含まれます。例：\<Password>password\</Password>。

**Repository** には、Appian のナレッジセンターの識別子が含まれます。例：\<Repository>5995\</Repository>。

*(Appian 12)* <a id="note-knowledgecenterid" />*(Appian 12)* **注意：** ナレッジセンターのIDを調べるには、ワークスペースの **Runtime Data** をクリックし、**Documents** セクションで目的のナレッジセンターを選択します。ワークスペース上部に、選択したナレッジセンターに対して実行できる操作が表示されます。ワークスペース上部の **Properties** をクリックすると、**Knowledge Center Properties** ダイアログが開き、ナレッジセンターのIDが表示されます。

<Frame>
  <img src="https://mintcdn.com/abbyy/M5jnw37NmJ-asKkj/images/flexi-capture/connectors/Appian3.png?fit=max&auto=format&n=M5jnw37NmJ-asKkj&q=85&s=5375e8694d4bba2f2e3fc3ed395a50d6" alt="選択したナレッジセンターのIDが表示されている、Appian ワークスペース内の Knowledge Center Properties ダイアログのスクリーンショット。" width="747" height="778" data-path="images/flexi-capture/connectors/Appian3.png" />
</Frame>

*(Appian 12)* **FolderPath** には、Appian で作成するフォルダーの名前を指定します。例：\<FolderPath>\<Batch>\</FolderPath>。

*(Appian 12)* **FileName** には、エクスポート時に作成されるドキュメントの名前が含まれます。例：\<FileName>\<Batch>\_\<Identifier>\</FileName>。

<Note>
  *(Appian 12)* ドキュメント名は、固定の静的部分と変化する動的部分で構成できます。動的部分はタグで定義し、エクスポート時に ABBYY FlexiCapture のドキュメントプロパティの値に置き換えられます。各タグは山かっこで囲む必要があります。XML ファイルでは:
</Note>

* *(Appian 12)* ‘\<’ は ‘\<’ を表します
* *(Appian 12)* ‘>’ は ‘>’ を表します

*(Appian 12)* 名前の動的部分に使用できるタグ：

* *(Appian 12)* ABBYY FlexiCapture のプロジェクト名には *Project* を指定します
* *(Appian 12)* バッチ名には *Batch* を指定します
* *(Appian 12)* ABBYY FlexiCapture の Document Definition 名には *DocumentDefinition* を指定します
* *(Appian 12)* ソースファイル名には *SourceFile* を指定します
* *(Appian 12)* バッチ内のドキュメント識別子には *Identifier* を指定します
* *(Appian 12)* バッチタイプ名には *BatchType* を指定します
* *(Appian 12)* yyyy-MM-dd\_HH-mm-ss 形式の現在時刻には *Time* を指定します

<Note>
  *(Appian 12)* これらの動的に置き換え可能なタグでは大文字と小文字が区別されるため、上記のタグで使われている文字の大文字・小文字はそのまま維持する必要があります。
</Note>

*(Appian 12)* 以下は、静的な部分を含むドキュメント名の例です。

```
<FileName>My_static_prefix_&lt;DocumentDefinition&gt;_&lt;Identifier&gt;and_postfix</FileName>
```

*(Appian 12)* 以下は、静的な部分を含まないドキュメント名の例です。

```
<FileName>&lt;Project&gt;_&lt;Identifier&gt;</FileName>
```

*(Appian 11, Appian 12)* **NameConflictResolution** は名前の競合を解決するために使用されます。指定可能な値：

* *(Appian 11, Appian 12)* *NewVersion* – ドキュメントの新しいバージョンが作成されます。
* *(Appian 11, Appian 12)* *NewName* – 新しい名前のドキュメントが新規作成されます。

*(Appian 11, Appian 12)*  例えば、

```
<CreationPolicy> 
  <NameConflictResolution>NewVersion</NameConflictResolution> 
</CreationPolicy>
```

*(Appian 11, Appian 12)* **DmsMetadataTemplate** には、Tempo に表示されるレコード型名を複数形で指定します。各 ABBYY FlexiCapture Document Definition には、Appian でそれぞれ固有のレコード型が必要です。たとえば、

```
<DmsMetadataTemplate>
  <Name>買掛金記録</Name>
</DmsMetadataTemplate>
```

*(Appian 11, Appian 12)* **FieldPairs** には、field の組み合わせのコレクションが含まれています。

*(Appian 11, Appian 12)* エクスポート設定がXMLファイルに保存されている場合は、次のようにfieldをマッピングします。

```
<FieldPairs>
 <FieldPair>
   <AfcField>Invoice\InvoiceNumber</AfcField>
   <DmsField>InvoiceNumber</DmsField>
 </FieldPair>
</FieldPairs>
```

*(Appian 11, Appian 12)* ここで、

* *(Appian 11, Appian 12)* *AfcField* は、エクスポート時にデータの読み取り元となる FlexiCapture Document Definition の field への完全パスです。

* *(Appian 11, Appian 12)* *DmsField* は、エクスポート時にデータの書き込み先となる Appian データ型の field です。

<Note>
  *(Appian 11, Appian 12)* XML ファイルで指定したエクスポート設定にのみ適用されます。スクリプトで指定したエクスポート設定の場合、field は次のようにマッピングします。
</Note>

```
Dictionary<string, string> pairs = new Dictionary<string, string>()
{
    { @"Invoice Layout\InvoiceNumber", "InvoiceNumber" },
    ...
};
connectorSettings.MappedFields.FieldPairs = new MappedFields(pairs).FieldPairs;
```

*(Appian 11、Appian 12)* ここで、カンマの前の値は FlexiCapture 内の field へのフルパス、カンマの後の値はデータ型内の対応する field の名前です。

<Note>
  *(Appian 11、Appian 12)* テーブルの値をマッピングする場合は、Appian で必ず[補助データ型を作成し](/ja/flexi-capture/connectors/appian/appian-fc-app-modify#datatype)、次のように fields をマッピングしてください。
</Note>

```
Dictionary<string, string> pairs = new Dictionary<string, string>()
{
    ...
    { @"Invoice Layout\LineItems\Description", @"LineItems\Description" },
    ...
};
connectorSettings.MappedFields.FieldPairs = new MappedFields(pairs).FieldPairs;
```

*(Appian 11, Appian 12)* ここで、2つ目のLineItemsは、補助データ型のオブジェクトのarrayを格納するメインデータ型内のfield名であり、Descriptionは補助データ型内でマッピングされたfield名です。
