At import it is possible to block or ignore defined values in specifications on presentation. This can be useful if e.g. a source system sends e.g. a value “000” or “---”, where this means no value. Ignoring such a value will prevent existing values to be overwritten or stop bad values from being imported.

The validation operates on imports in import storage and on XLS imports.

This function is available in version 5.0 and later.

Overview

Validation at import is configured in import.config. Validation is set up as rules, each rule having a few settings. Validation operates on specifications on presentations.

Validation option

Usage

Ignore

If value defined in target-value is encountered at import, this value will be ignored (considered NULL). No values will be imported, and any existing value will not be overwritten.

Replace

If value defined in target-value is encountered at import it will be replaced by the value in replace-value.

Exception

If value defined in target-value is encountered at import, import will stop with an exception.

Configuration

In import.config add the configuration needed. Sample configuration:

<Specifications>
  <!-- Ignore EAN codes with values "xxx" -->
  <SpecificationValidationConfig enabled="true" validation-option="Ignore">
    <target-value culture="en-GB" value="xxx" />
    <replace-value culture="en-GB" value="" />
    <specification-type-persistentidentity>EAN</specification-type-persistentidentity>
  </SpecificationValidationConfig>
  
  <!-- Replace country codes with values "pt-BR" with "pt" -->
  <SpecificationValidationConfig enabled="true" validation-option="Replace">
    <target-value culture="en-GB" value="pt-BR" />
    <replace-value culture="en-GB" value="pt" />
    <specification-type-persistentidentity>Country</specification-type-persistentidentity>
  </SpecificationValidationConfig>  
  
  <!-- Stop import if code "X" comes -->
  <SpecificationValidationConfig enabled="true" validation-option="Replace">
    <target-value culture="en-GB" value="X" />
    <replace-value culture="en-GB" value="" />
    <specification-type-persistentidentity>NLACode</specification-type-persistentidentity>
  </SpecificationValidationConfig> 
</Specifications>

Related articles

The content by label feature displays related articles automatically, based on labels you choose. To edit options for this feature, select the placeholder below and tap the pencil icon.

Related issues