1. Walkthroughs

Walkthrough: Synchronizing data from a text file to Sitecore

Version:

This walkthrough tells you how to configure a pipeline batch that uses the file system provider to create and populate Sitecore items from the contents of a text file.

In this walkthrough, you create a file that contains information about different cities. Each row in the file represents a single city. Each city is represented in Sitecore as an item.

The synchronization process reads the cities from the file and creates Sitecore items for each. If a Sitecore item already exists for a city in the file, the Sitecore item is updated with the information from the file.

The walkthrough shows you how to perform the actions in the following table.

ActionTopics
create a test import fileCreate a source file
create a tenant to contain all the DEF items and settings neededCreate a tenant
prepare the Sitecore content database for receiving the imported valuesCreate a template for target items

Add a parent item for target items
create components to read the lines from the source fileAdd an endpoint for the source file

Add value accessors for the source file
create components to write the lines to the Sitecore content databaseAdd an endpoint for target items

Add value accessors for the target items
create a pipeline that receives a line from the source file, transforms its values, and writes them to the Sitecore content databaseAdd a pipeline to read the source file

Add a pipeline step to read data from a source file

Add a pipeline step to iterate the data read from a source file
create a pipeline that reads the source file, and calls the first pipeline for each lineAdd a pipeline to sync a single row from the source file

Add a pipeline step to resolve the target item

Add a pipeline step to apply mappings

Add a pipeline step to update the target item
create a pipeline batch that runs the pipelines in sequenceAdd a pipeline batch
run the pipeline batchTest a pipeline batch
If you have suggestions for improving this article, let us know!