SITECORE LIST MANAGER ( Part 2 ) : Add predefined facets field in Sitecore List Manager Import map

 


Sitecore Versions: 9.x, 10.x

Sitecore List Manager allows you to create lists of recipients that can be used for Sitecore Email Experience Manager campaigns, marketing automation campaigns, or any other external system.

In the List Manager, when you import contacts from a CSV file, you can map fields from the imported file to the following default Sitecore fields:

    • Email address
    • First Name
    • Last Name

  • In some scenarios, we need to map additional Sitecore fields using List Manager CSV import. We can either map values for facets that are predefined in Sitecore or we can map values for custom facets as well.

  • We’ll see how to import and export additional predefined Sitecore fields using List manager. In the next part, we will see how to import custom facets using List manager.

Predefined contact facets – The available predefined contact facets that you can add to the Import contacts wizard are:

  • PersonalInformation
  • EmailAdressList
  • AddressList

To add a predefined mapping field:

  1. In the Core database, in the Content Editor, navigate to the /sitecore/client/Applications/List Manager/Dialogs/ImportWizardDialog/PageSettings/TabControl Parameters/Map/ImportModel folder.

  2. Right-click the ImportModel folder, click Insert and then click one of the predefined contact mapping fields.

3. In our case, we created Personal – Nick Name. Notice FieldName and DataField are automatically filled.


  • Also Notice, we did not mark this as Required. The Required field specifies if the field mapping must be specified on the Map tab of the Import contacts wizard.
  • This is a UI validation only. If you want to mark a mapping field as required, you must also add the mapping field to the list of required fields in the Sitecore.ListManagement.config file, 
    in the ListManagement.Import.RequiredFields setting:



    4. Now in the ListManager dashboard, create a list from the file. And browse for CSV (CSV should have data against headers Email, FirstName, LastName, NickName), Map the fields.



5. Now to enable the export of predefined facets to a CSV file, we need to create ContactDataReader class

6. In the App_Config\Include\ListManagement\Sitecore.ListManagement.config file, in the listManager.export pipeline, register the new one:

7. Now check if data for the newly added fields are getting exported correctly. Click on Export contact. CSV will download and you’ll see NickName data is there

  • This was pretty simple because Sitecore has already provided items for additional out-of-the-box facets.
  • In the next part, we’ll see how to import and export custom facets using the list manager.

Comments

  1. https://sitecorewithraman.wordpress.com/2021/03/21/customize-list-manager-part-i/

    ReplyDelete

Post a Comment