Overview

The idea behind this post is how to import data through feed for multi-value field. Feeds Tamper module gives you the feature to import multi-value field data into system. Let's understand this step by step.

Problem Statement:

You have to import data for Page content type where one field contains multivalue field. There is some games associated with every basic page that need to be imported through feed.

Step 1: Enabled the module.
Enabled all modules. Don't forget to enable Feeds Tamper Admin UI module.
Enabled Modules

Step 2: Add multi-value field.
Add multi-value field in page content type. Here we add "Associated Games" field with some values and enabled "Unlimited" values option.
Add multi-value field

Step 3: Add Importer.
Go to admin/structure/feeds/create and add importer there. Here we add "Pages Importer" of Node Processor type.
Add Importer.

Step 4: Setting for Node Processor.
Enable Basic page content type and choose appropriate option from "Update existing nodes". We choose "Update existing nodes" option here that enable existing content will get update in case same data imported.
Setting for Node Processor.

Step 5: Add Multi-value field in importer.
Choose "Mapping" tab under "Processor" option and add "games" field there that contains multi-value data.
Add Multi-value field in importer

Step 6: Do tamper setting.
Click to Tamper link and do the required setting for your multi-value field.
Do tamper setting.

Step 7: Add plugin.
Add plugin for "games" field and choose the explode option for plugin. This option would enable you to import multi-value field data, separated by some special symbol.
Add Plugin
Configure Explode

Step 8: Prepare CSV.
Now go to your importer link. Here we have created "page_importer", so go to import/pages_importer and download the sample template in which you would keep your data. Both screenshot would help you to understand how to prepare your csv.

Download Template

CSV scrrenshot

Note: Don't give extra space after comma(,) in your csv.

Step 9: Check CSV data.
Go to admin/content and look for your data.
Imported Content

Step 10: Done.
Check for "ken" row, it would display all three games are associated with this i.e Football,Tennis,Cricket.
Imported Done

Comments

Deepak Goyal’s picture

For field collection fields its not working?

sreher’s picture

One Hint: If you get an error with "NULL" value. Please check your data, if there is a record with no value or add a filter, to check if a value is requried.
The error message is misleading.

Qadees’s picture

Thanks for the great example.
My question is how do I add more values to the games field on an update?
I when I import multiple values for games it worked perfectly but when I tried to update existing content using the title as a unique Id to add more values to the games field on already created content it overwrites what was in the games field instead of adding it up.