How to configure unique fields in Drupal feeds importer ?

Drupal feeds module provides the possibility to define SOME fields as unique fields when importing content (such as the Title field of a node for example). However, you might sometimes need to configure other fields as unique. Here is how you can do it, using the Field Validation module.

The Use Case

Let’s assume you are collecting contact data in user profile entities, using the profile2 module. You have an email field in your profile2 entity and you would like, when importing user profiles from a CSV file, this email field to be considered as unique. For Feeds, this email field is just a basic simple field and, by default, Feeds won’t provide you with the possibility to set it as unique. Here is how to do it.

Use the Field Validation module

  1. Download and enable the Field Validation module

4. Go back to your Feeds Importer configuration, in the Mapping of the Entity: you will now be able to select your email field as Unique !

A simple procedure once you know about it, but it took me some time to find it, so I figured I would share it.

Originally published at https://www.gvj-web.com on August 22, 2013.

Développeur web et passionné de finances personnelles

Développeur web et passionné de finances personnelles