Class ColumnMapping
A class implementation of IDataMappingPropertyBase used for providing mappings for importing data with
See https://web.lemonedge.com/help/data-mapping-properties-view/ for more information
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Entities.Processors.Importing
Assembly: API.dll
Syntax
public class ColumnMapping : IDataMappingPropertyBase
Properties
ColumnHeaderName
If you are using a mapping with headers then here you can specify the name the column heading will have as it appears in the file. This doesn't need to be in order it appears in the file, just needs the matching name.
If the file has no column headings then this can be left blank and the column order is all that matters(see Sequence).
You can also use this value in a formula for other properties if you want. To do that you can use this Column Header Name in a formula by using %NAME%. In which case if this is blank you can provide it a unique name anyway for referring to it in a formula later on.Declaration
public string ColumnHeaderName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DataSourceTypeID
Indicates the value found during this import should be used to find the matching
Declaration
public Guid? DataSourceTypeID { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
OverrideValue
A hard coded value to always use for this property
Declaration
public string OverrideValue { get; set; }
Property Value
Type | Description |
---|---|
System.String |
OverrideValueFormula
A formula (see our formula engine for more info) that is evaluated for each record and the result used for this property. This formula can also refer to other columns in this file by using %COLUMN_HEADER_NAME% in the formula.
Declaration
public string OverrideValueFormula { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PropertyName
Provides the property name the data in this column should be mapped to against the specified entity type in the Data Mapping. Including the entity types actual properties, this list also includes the following additional mappings:
- Not Mapped: Indicates this column is not mapped to any property. The data value it contains can be referenced in formulas using %COLUMN_HEADER_NAME%.
- Import Data Action:
Indicates how to process the data.Valid Values are:
None - Ignore this record
Import - Create, update, or process a custom action for this recordDelete - Delete the matching record
- Import Data Type: Indicates the entity type of the data being imported. Not required as specified by the mapping anyway.
- Data Sources: Indicates the data should be mapped to a unique data source field holding keys relating to 3rd party systems.See here for more info on Data Sources.
Declaration
public string PropertyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Sequence
The sequence specifies the order this column will be found in the import file. This only matters if "Use Headers" on the Data Mapping is set to false.
Declaration
public short Sequence { get; set; }
Property Value
Type | Description |
---|---|
System.Int16 |
TrimValue
Removes leading and trailing spaces from the data before parsing it for this property data type.
Declaration
public bool TrimValue { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseAsKey
Indicates this value should be used as part of a key when looking up if this record exists. This is because the import routines automatically update existing records or insert new ones depending on if it can find existing records. Normally this is determined using the entity types standard keys, but you can override that here and use other unique combinations or unique data source ids from 3rd party systems.
Declaration
public bool UseAsKey { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
CloneFrom(IDataMappingPropertyBase)
Creates a new ColumnMapping from an implementation of IDataMappingPropertyBase
Declaration
public static IDataMappingPropertyBase CloneFrom(IDataMappingPropertyBase source)
Parameters
Type | Name | Description |
---|---|---|
IDataMappingPropertyBase | source | An implementation to copy |
Returns
Type | Description |
---|---|
IDataMappingPropertyBase | A new ColumnMapping from an implementation of IDataMappingPropertyBase |
GetMapping()
If this maps to a system entity/property this function should return that mapping.
The system sets it through SetMapping(EntityImportColDefinition)
Declaration
public EntityImportColDefinition GetMapping()
Returns
Type | Description |
---|---|
EntityImportColDefinition |
SetMapping(EntityImportColDefinition)
If this maps to a system entity/property this function allows the system to set the mapping
Declaration
public void SetMapping(EntityImportColDefinition mapping)
Parameters
Type | Name | Description |
---|---|---|
EntityImportColDefinition | mapping | The system mapping definition this relates to |