How to configure unique fields in Drupal feeds importer ?

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
  2. Enable the Field Validation UI module that comes bundled with the Field Validation module
  3. Go into Structure > Field Validation and add a new rule, with the following parameters (for the validator, select “Unique Values” and for the scope, select Bundle or Entity depending on what you need):

--

--

Développeur web et passionné de finances personnelles

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Guillaume Viguier-Just

Guillaume Viguier-Just

Développeur web et passionné de finances personnelles