Interface IDataMappingPropertyBase
A common interface that a data mapping property implements. The system entity IDataMappingProperty implements this functionality
See https://web.lemonedge.com/help/data-mapping-properties-view/ for more information
Namespace: LemonEdge.API.Entities
Assembly: API.dll
Syntax
public interface 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
[EntityProperty(SQLType.NVarChar, (short)500, true)]
[EntityDescription("The name of the column header in the file. Can be blank if headers aren't being used, and then columns are purely processed on index order.")]
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 IDataSource for the selected IDataSourceType to return the ID of the item to link to.
Declaration
[EntityProperty(SQLType.UniqueIdentifier, true)]
[EntityRelationship(EntityID.DataSourceTypes, "ID", SingleJoinType.ZeroToOne, "Data Source Type", "Mappings", DeleteWithRelationship = false, PartOfParentSet = false, LinkToItemInSet = false, InheritPermissions = false)]
[EntityDescription("Indicates the value found during this import should be used to find the matching DataSourceID for the selected DataSourceType to return the ID of the item to link to.")]
Guid? DataSourceTypeID { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
OverrideValue
A hard coded value to always use for this property
Declaration
[EntityProperty(SQLType.NVarChar, (short)100, true)]
[EntityDescription("Overrides with this explicit value.")]
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
[EntityProperty(SQLType.NVarChar, true)]
[EntityDescription("Evaluates the formula using the current object and overrides with the result.")]
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
[EntityProperty(SQLType.NVarChar, (short)500, true)]
[EntityDescription("The property on the object this mapping relates to.")]
string PropertyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Sequence
[Key] 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
[EntityProperty(SQLType.SmallInt, false, "0")]
[EntityDescription("If the mapping is not using headers, then columns are processed in this order.")]
[EntitySequence]
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
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Indicates leading/trailing spaces in the file for this value should be removed before being processed.")]
bool TrimValue { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseAsKey
Normally the import identifies if an item already exists by the key fields defined for that entity type. If you want to override that (perhaps by using an external DataSource ID instead) then you can set this to indicates which columns are to be used as key fields for lookup instead.
Declaration
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Normally the import identifies if an item already exists by the key fields defined for that entity type. If you want to override that (perhaps by using an external DataSource ID instead) then you can set this to indicates which columns are to be used as key fields for lookup instead.")]
bool UseAsKey { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
GetMapping()
If this maps to a system entity/property this function should return that mapping.
The system sets it through SetMapping(EntityImportColDefinition)
Declaration
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
void SetMapping(EntityImportColDefinition mapping)
Parameters
Type | Name | Description |
---|---|---|
EntityImportColDefinition | mapping | The system mapping definition this relates to |