---
title: "Implement an endpoint converter"
slug: "implement-an-endpoint-converter"
abstract: "How to convert a Sitecore item into a component in Sitecore Data Exchange Framework."
---
# Implement an endpoint converter

You must have a converter in order to convert a Sitecore item that represents a component into an actual component. In this example, a converter converts the settings on an endpoint item into an endpoint settings plugin. You can then add that plugin to the endpoint.

To implement an endpoint converter:

1. In Visual Studio, add the following class:

    ```csharp
    using Sitecore.DataExchange.Attributes;
    using Sitecore.DataExchange.Converters.Endpoints;
    using Sitecore.DataExchange.Models;
    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.Providers.FileSystem
    {
        [SupportedIds(TextFileEndpointTemplateId)]
        public class TextFileEndpointConverter : BaseEndpointConverter
        {
            public const string TextFileEndpointTemplateId = "[ENDPOINT TEMPLATE ID]";
            public const string TemplateFieldColumnSeparator = "ColumnSeparator";
            public const string TemplateFieldColumnHeadersInFirstLine = "ColumnHeadersInFirstLine";
            public const string TemplateFieldPath = "Path";
            public TextFileEndpointConverter(IItemModelRepository repository) : base(repository)
            {
            }
            protected override void AddPlugins(ItemModel source, Endpoint endpoint)
            {
                //
                //create the plugin
                var settings = new TextFileSettings
                {
                    //
                    //populate the plugin using values from the item
                    ColumnHeadersInFirstLine = this.GetBoolValue(source, TemplateFieldColumnHeadersInFirstLine),
                    ColumnSeparator = this.GetStringValue(source, TemplateFieldColumnSeparator),
                    Path = this.GetStringValue(source, TemplateFieldPath)
                };
                //
                //add the plugin to the endpoint
                endpoint.AddPlugin(settings);
            }
        }
    }
    ```

    > [!important]
    > You must change the value of `[ENDPOINT TEMPLATE ID]` to match the ID from the endpoint template named *Text File Endpoint*.

    > [!note]
    > By inheriting from `[BaseEndpointConverter](base-endpoint-converter.html "Base endpoint converter")` you get access to a number of methods that facilitate reading values from fields on a Sitecore item.

2. Compile the project.
3. Deploy `Examples.DataExchange.Providers.FileSystem.dll` to the Sitecore server.