Integrate a custom value mapping set

Version: 2.0

The final step is to integrate your custom value mapping set into Data Exchange Framework.

When configuring your data synchronization process, use your custom value mapping set when you create new tenants. For already existing tenants, replace the value mapping set currently used with your custom value mapping set.

Configure the custom template

To configure the template to use the custom converter and the custom value mapping set:

  1. In the Content Editor, navigate to /sitecore/templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set/__Standard Values.

  2. On the Configure tab, in the Data Exchange Framework section, set the following field values:

    Field

    Value

    Converter Type

    Examples.DataExchange.CustomMappingSetConverter,Examples.DataExchange

  3. On the menu ribbon, click the CONFIGURE tab.

    Configure tab in menu ribbon
  4. In the menu, click Assign.

    Assign option on menu ribbon
  5. In the Insert Options dialog, in the tree on the left, navigate to Templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set. Click the right arrow (Arrow pointing right) to add the set to the Selected list.

    Insert Options dialog
  6. Click OK.

Implement a converter for a custom value mapping set

In Data Exchange Framework, Sitecore items are only used for configuration. When a data synchronization process runs, the configuration is read from the Sitecore items and then converted into framework components.

Get template item ID

To link the converter to the custom value mapping set template, you must locate and copy the template item ID.

To do this:

  1. In the Content Editor, navigate to /sitecore/templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set.

  2. Click the Content tab.

  3. In the Quick Info section, copy the Item ID value.

    Quick Info section on the Content tab, showing the Item ID value.

Implement custom converter class

You need a custom converter to transform the Sitecore item representing the custom value mapping set into an instance of your custom value mapping set type.

To implement the class:

  • In Visual Studio, add the following class:

    RequestResponse
    using Sitecore.DataExchange;
    using Sitecore.DataExchange.Attributes;
    using Sitecore.DataExchange.Converters;
    using Sitecore.DataExchange.Repositories;
    using Sitecore.Services.Core.Model;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Examples.DataExchange
    {
        [SupportedIds("{00000000-0000-0000-0000-000000000000}")]
        public class CustomMappingSetConverter : BaseItemModelConverter<CustomMappingSet>
        {
            public CustomMappingSetConverter(IItemModelRepository repository) : base(repository)
            {
            }
            private static CustomMappingSet _instance = new CustomMappingSet();
            protected override ConvertResult<CustomMappingSet> ConvertSupportedItem(ItemModel source)
            {
                return ConvertResult<CustomMappingSet>.PositiveResult(_instance);
            }
        }
    }
    
Note

In the attribute SupportedIds, use the template item ID you copied in the previous step.

Deploy custom components

To deploy the code to your Sitecore server:

  1. Build the Visual Studio project.

  2. Copy the Examples.DataExchange.dll file to your Sitecore server.

Do you have some feedback for us?

If you have suggestions for improving this article,