Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Map Multi-value Fields With the Separator Method

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:00
  • 0:03
    Map Multi-value Fields With the Separator Method
  • 0:06
    with Joe Shindelar
  • 0:08
    JOE SHINDELAR: So far all of the fields that we've been dealing
  • 0:10
    with on the Drupal side of things are single-value fields,
  • 0:14
    meaning each of them can only store one value.
  • 0:17
    However, Drupal's field API allows us to create multi-value fields.
  • 0:22
    What I want to do is take a look at how we can import data
  • 0:24
    from our source into a multi-value field in Drupal.
  • 0:29
    There's a couple of ways that we can do this.

Map Multi-Value Fields with the Separator Method


This lesson is a short one but it covers an important topic, multi-value fields. Almost any field in Drupal can be configured to support more than one value being entered for a single field. Our teams entityreference field is a good example of this, a player could have played for one or more team over the course of their career. This lesson will look at two different ways to map multiple values for a single field.

First we'll look at doing it in a callback method where we perform an additional query and then use the values returned by that query. And second we'll look at using the field mapping's separator method to take a column in a source row that has multiple values separated by a comma and import them as individual field values.

Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.