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

# Specifying export settings and mapping fields

> Reference for every M-Files export field, including Server, Repository, FileName tags, FieldPairs mappings, image options, and workflow assignment.

This section describes the fields of the **M-Files - ExportScript - Configure by script.cs** and **default.config.xml** configuration file.

**Server** contains the URL to be used for accessing to M-Files over the Internet. For example, \<Server>[http://m-files-server\&lt;/Server>](http://m-files-server\&lt;/Server>).

<Note>
  For detailed instructions on configuring web access, please refer to the [M-Files User Guide](https://www.m-files.com/user-guide/latest/eng/enabling_web_and_mobile_access.html).
</Note>

**Username** contains the name of the user in M-Files. This may be either a domain name, or a local name on M-Files Server. For example, \<Username>username\</Username>.

**Password** contains the user's password. For example, \<Password>password\</Password>.

**Repository** contains the name of the document vault in M-Files. For example, \<Repository>DocumentVault\</Repository>.

**FolderPath** contains the object type name. For example, \<FolderPath>Document\</FolderPath>.

**FileName** contains the name of the document that will be created at the time of export. For example, \<FileName>\&lt;Batch\&gt;\_\&lt;Identifier\&gt;\</FileName>.

<Note>
  The name of the document may have an unchanging static part and a changing dynamic part. The dynamic part is defined by tags, which are replaced by the ABBYY FlexiCapture document property values at the time of export. Each tag must be enclosed in angle brackets. In the XML file:
</Note>

* ‘\&lt;’ stands for ‘\<’
* ‘\&gt;’ stands for ‘>’

Possible tags for the dynamic part of the name:

* *Project* for the name of the project in ABBYY FlexiCapture
* *Batch* for the name of the batch
* *DocumentDefinition* for the name of the Document Definition in ABBYY FlexiCapture
* *SourceFile* for the name of the source file
* *Identifier* for the document identifier in the batch
* *BatchType* for the name of the batch type
* *Time* for the current time in yyyy-MM-dd\_HH-mm-ss format

<Note>
  You can use dynamic replacement tags '\<FolderPath>', '\<Template>,' and '\<FileName>' to update documents sent from M-Files to FlexiCapture for processing. If the FlexiCapture batch was created by the M-Files workflow activity "Abbyy.MFiles.FlexiCapture.Activity.dll":
</Note>

* A runtime replacement tag '\<FolderPath>' can be used in the **FolderPath** configuration field instead of an explicit object type name.
* A '\<Template>' tag can be used in the **DmsMetadataTemplate** configuration field instead of an explicit class name.
* A '\<FileName>' tag can be used in the **FileName** instead configuration field of an explicit document name.

These tags are replaced with the value of the batch registration parameters. The batch registration parameters are created by the M-Files workflow activity. The original document in M-Files will be updated based on these registration parameters. These dynamically replaceable tags are case-sensitive and the register of the characters used in the tags above should be preserved.

The following is an example of a document name with a static part:

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

The following is an example of a document name without a static part:

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

**NameConflictResolution** is used to resolve name conflicts. Possible values:

* *NewVersion* – A new version of the document will be created.
* *NewName* – A new document with a new name will be created.

For example,

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

<Note>
  The **NewVersion** option allows updating the document in M-Files if the name and format specified in the script match the name and format of the document in M-Files. If the names and formats of the two documents do not match, a new document will be created in M-Files.
</Note>

**DmsMetadataTemplate** contains the name of the document class in M-Files. For example,

```
<DmsMetadataTemplate>
  <Name>Invoice</Name>
</DmsMetadataTemplate>
```

**FieldPairs** contains a collection of field pairs. This collection is used for mapping ABBYY FlexiCapture document definition fields to M-Files property definitions.

If your export settings are stored in an XML file, map the fields as follows:

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

where:

* *AfcField* is the full path to the FlexiCapture Document Definition field from which data are to be read at the time of export.

* *DmsField* is the name of the M-Files property definition where data will be written at the time of export.

If your export settings are specified in the script, map the fields in a dictionary as follows:

```
Dictionary<string, string> pairs = new Dictionary<string, string>()
{
    { @"Invoice Layout\InvoiceNumber", "Invoice number" },
    { @"Invoice Layout\InvoiceDate", "Invoice date" },
};
```

In the pairs above, the value before the comma is the full name of a field in the FC Document Definition and the value after the field is the name of the respective property definition in M-Files.

**SaveDocumentImages** – Specifies whether or not to export the image. When set to *true*, the connector will send both the document image and the extracted fields to M-Files; otherwise, only the extracted fields will be sent to M-Files.

**ExportImageSavingOptions** contains the image saving options to be used at the time of export, such as the format of the exported image, its quality, and redacted areas. For a detailed description of the image saving options, see [IExportImageSavingOptions](/flexi-capture/appendix/scripts/iexportimagesavingoptions).

**DmsSpecificOptions** – These are settings specific to M-Files:

* *Workflow* – The name or alias of the workflow that will be assigned to the document once export from FC to M-Files is complete (optional). For example.

```
<DmsSpecificOptions>
    <Option>
      <Name>Workflow</Name>
      <Value xsi:type="xsd:string">Invoice.Workflow</Value>
    </Option>
  </DmsSpecificOptions>
```
