XML.Import.SetExtraField
------------------------

Sets the extra field to add to all tables.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XML](component_XML.md) | [7.1](newinversion71.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XML.Import.SetExtraField"; FieldName; FieldValue { ; FieldType } ) 

**MBS**( **"XML.Import.SetExtraField";** /\* Sets the extra field to add to all tables. \*/  
**$FieldName**; /\* The name of the extra field.e.g. "ImportID" \*/   
**$FieldValue**; /\* The value for this field.  
Can be any data type, but must match field type.e.g. 1 \*/   
**$FieldType**) /\* Optional; The SQL field type.  
Default is "VARCHAR" for a text field.e.g. "VARCHAR" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| FieldName | The name of the extra field. | "ImportID" |  |
| FieldValue | The value for this field.   Can be any data type, but must match field type. | 1 |  |
| FieldType | The SQL field type.   Default is "VARCHAR" for a text field. | "VARCHAR" | Optional |

### Result

Returns OK or error.

### Description

Sets the extra field to add to all tables.  
Please call before [XML.Import](XMLImport.md).  
You can call it again when import loop is done and pass in empty name and value to clear it.  
Only one extra field and only added when table is created.  
### Examples

Set extra field:

 Set Variable \[ $r ; Value: MBS ( "XML.Import.SetExtraField"; "test"; "Hello"; "VARCHAR") \]  
### See also

- [JSON.Import](JSONImport.md)
- [JSON.Import.SetExtraField](JSONImportSetExtraField.md)
- [XML.Import](XMLImport.md)
- [XML.Import.SetBaseFields](XMLImportSetBaseFields.md)
- [XML.Import.SetExtraFieldDefinitions](XMLImportSetExtraFieldDefinitions.md)

### Release notes

- **Version 13.5**
    - Added [XML.Import.GetExtraFieldDefinitions](https://www.mbsplugins.eu/XMLImportGetExtraFieldDefinitions.shtml) and [XML.Import.SetExtraFieldDefinitions](https://www.mbsplugins.eu/XMLImportSetExtraFieldDefinitions.shtml) functions to create custom fields.
- **Version 7.1**
    - Added [XML.Import.SetBaseFields](http://www.mbsplugins.eu/XMLImportSetBaseFields.shtml) and [XML.Import.SetExtraField](http://www.mbsplugins.eu/XMLImportSetExtraField.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 7.1pr1](https://www.mbsplugins.de/archive/2017-02-04/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 2nd February 2017 , last changed 19th June 2019

  
[XML.Import.SetBaseFields](XMLImportSetBaseFields.md) - [XML.Import.SetExtraFieldDefinitions](XMLImportSetExtraFieldDefinitions.md)

[HTML Version](XMLImportSetExtraField.shtml)