Brian McKeiver's Blog

Kentico 8.2 Quick Tip for Importing Contacts


As you probably know the release of Kentico 8.2 is right around the corner. During my initial testing of this minor point release, a few of the new online marketing features have piqued my interest. The change to Email Campaigns from Newsletters is pretty nice, the online marketing performance improvements are welcome, and the ability to import Contacts from a file rounds out what's new in this area of Kentico. The ability to import contacts from a CSV file is nothing earthshaking, however, I was pretty curious to see how it was implemented in 8.2 so I decided to put it through its paces.

Importing Contacts in Kentico 8.2

The first thing that I had to do to use this feature as get a list of contacts generated. As I have mentioned before, we use Zoho CRM at BizStream for our contact management application. Zoho makes exporting out a list of contacts really simple. I was able to quickly generate a small dataset of contacts as a csv file. That file included the standard fields you would expect, First name, Last name, Phone, Email, etc. etc., but it also included a few custom fields that we use.

After firing up my test Kentico 8.2 instance I navigated to the new Contact import vertical tab inside of the Contact Management module. From there the process was pretty straight-forward. After choosing which file I wanted to upload the app asked me to then map the columns of the file to OM Contact attributes. One mapping section per column was generated by Kentico which allows you to map any field you have in the file. Clicking go iterated through the file and generated a bunch of OM Contacts for me.  It just worked. 

Kentico 8.2 Contact management -import from csv file

Kentico 8.2 Import Contacts

During my test runs I noticed a pretty cool detail that allows developers to customize the mapping of Contact fields from the input file to the OM Contact record. This detail is especially important if you have custom fields in your Kentico online marketing solution or your external CRM system. The reason it is important is because the default "Maps to" dropdown for the screen only has a few basic fields in it. So the question is, how do we change which fields are in the Maps to input ?

Kentico 8.2 Import Contacts Map To

And the answer is… as always the guys and girls over at Kentico developed a great solution, that rarely, if ever, uses something that is hard coded. For this situation, the Kentico Forms Engine comes to the rescue to allow for modifying the input. Yes, that's right, to change the fields that you can "map to" in your contact import, you simply have to go modify the "Import contacts columns" alternate form on the Contact class in the Contact management module.

Kentico 8.2 Contact management module

The key is to enable the Display on Editting Form checkbox on your custom fields so that they show up in the "Map to" dropdown on the contact import screen.

Kentico 8.2 Form Engine


The Result

I now have the ability to map to my own custom fields when I am importing contacts from a CSV file.

Kentico 8.2 Contacts import custom fields

If you want to see more on this feature you can also check out Vita's blog post on importing contacts from a file as well. Happy coding.