6.1. Add Value Accessor TemplateΒΆ
A value accessor is the component that is used to read a value from a source object or write a value to a target object.
The pipeline step read a file and converts each row in the file into an array of strings. A value accessor is used to identify the position in the array you want to use.
Consider an example where you have a file that contains comma-separated values (CSV) that provide details about new customers. The file looks like the following:
first,last,company Aaron,Adkins,Ace Corp Brad,Bedford,Burnside Bread Charlotte,Colson,Carefree Farms
A template is needed to allow a person configuring a sychronization process to idenfity that the first name is at position 1, the last name (surname) is at position 2 and the company name is at position 3.
In Sitecore, open Template Manager.
Navigate to Templates > Data Exchange > Providers > File System.
Add a template folder named Data Access.
Add the following template:
Name Array Value AccessorBase template Templates > Data Exchange > Framework > Data Access >Value Accessors > Value AccessorLocation Templates > Data Exchange > Providers > File System > Data AccessSet the icon for this template to
office/32x32/radio_button_selected.png
.Add a section named Settings.
Add the following field:
Name Position Type Integer Shared ticked