Add value mappings

Abstract

How to add value mappings in Sitecore Data Exchange Framework to associate source and target objects.

You use value mappings to associate a value accessor for a source object with a value accessor for a target object. In this example, value mappings associate the value accessors you use to read values from the text file with the value accessors you use to write values to the corresponding Sitecore item.

Create a value mapping set

Just like related value accessors (such as all the value accessors used to read values from a specific type of text file) are grouped together under a value accessor set, related value mappings are grouped together under a value mapping set.

In this example, you create a value mapping set to represent all of the values you must map from a row in a text file to a Sitecore item.

To create a value mapping set:

  1. In Sitecore Content Editor, navigate to sitecore/System/Data Exchange/File System Provder Test Tenant/Value Mapping Sets.

    value-mapping-sets-empty.png
  2. On the Folder tab, click Value Mapping Set to create a new item, and name it Row from City Information File to City Information Item

Create value mappings for the target items

You must create value mappings for the Identifier, Country, and City Sitecore items

To create the value mappings:

  1. Navigate to the new Value Mapping Set.

    value-mapping-set-empty.png
  2. On the Folder tab, click Value Mapping to create a new item, and name it Identifier.

  3. Select the new item.

  4. Set the following field values:

    Field

    Value

    Source Accessor

    Data Access/Value Accessor Sets/Providers/File System/City Information File Fields/Identifier from City Information File

    Target Accessor

    Data Access/Value Accessor Sets/Providers/Sitecore/City Information Item Fields/Identifier on City Information Item

    Source and target accessor fields.
  5. Save the item.

  6. Repeat step 1 to 5 to add two more Value Mappings:

    Name

    Source accessor

    Target Accessor

    Country

    Data Access/Value Accessor Sets/Providers/File System/City Information File Fields/Country from City Information File

    Data Access/Value Accessor Sets/Providers/Sitecore/City Information Item Fields/Country on City Information Item

    City

    Data Access/Value Accessor Sets/Providers/File System/City Information File Fields/City from City Information File

    Data Access/Value Accessor Sets/Providers/Sitecore/City Information Item Fields/City on City Information Item