Migrating into Double field I am migrating a CSV into D8 node type which has a double field. The CSV has the following structure:



I am trying to migrate the year, from the header, into the first double-field subfield (as a label) and the population data for each country (Afganistan, in the example above) into the second double-field subfield.

The double-field has the following interface (the data in this example was entered manually):


And, this is how the data is represented in the node as seen via Devel:


I have tried a variety of things in my migration yaml code but I have not been able to migrate either the year nor population data. My code is below:

.
.
.
process:
  type:
    plugin: default_value
    default_value: census
  title: 'Country Name'
  field_country_code: 'Country Code'
  field_count_first:
    0:
      plugin: get
      source: 
        - 1960
.
.
.
------- also - tried -----------
.
.
.
process:
  type:
    plugin: default_value
    default_value: census
  title: 'Country Name'
  field_country_code: 'Country Code'
  field_count:
    first:
      0:
        plugin: get
        source: 
          - 1960
.
.
.


I would appreciate some help.
Ran into exactly the same issue, here is my solution. In my case for field 'first' I have a select list of contact types in field 'second' it is a plain text field. For one of the source fields I am converting a taxonomy term to a plain text so there is a service injected to do a lookup up from the source database. The migration config looks like this for the fields I want to convert:

  field_phoned:
    -
      plugin: add_contact_info_field
      target_field: field_contact_info
      target_label: num_office
      source: field_phoned
  field_mobile_number:
    -
      plugin: add_contact_info_field
      target_field: field_contact_info
      target_label: num_mobile
      source: field_mobile_number
  field_skype_contact:
    -
      plugin: add_contact_info_field
      target_field: field_contact_info
      target_label: skype
      source: field_skype_contact
  field_whatsapp_number:
    -
      plugin: add_contact_info_field
      target_field: field_contact_info
      target_label: whatsapp
      source: field_whatsapp_number
  field_location_taxonomy:
    -
      plugin: add_contact_info_field
      target_field: field_contact_info
      target_label: location
      source: field_location_taxonomy


The process plugin 'add_contact_info_field':

&lt;?php

namespace Drupal\custom_migrate_tools\Plugin\migrate\process;

use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\custom_migrate_tools\TermLookupInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a 'AddParagraphBody' migrate process plugin.
 *
 * @MigrateProcessPlugin(
 *  id = "add_contact_info_field"
 * )
 */
class AddContactInfoField extends ProcessPluginBase implements ContainerFactoryPluginInterface {

  /**
   * Lookup source term service.
   *
   * @var \Drupal\custom_migrate_tools\TermLookupInterface
   */
  protected $termLookup;

  /**
   * The migration.
   *
   * @var \Drupal\migrate\Plugin\MigrationInterface
   */
  protected $migration;


  /**
   * TaxonomyLookup constructor.
   *
   * @param array $configuration
   * @param $pluginId
   * @param $pluginDefinition
   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
   * @param \Drupal\custom_migrate_tools\TermLookupInterface $termLookup
   */
  public function __construct(array $configuration,
                              $pluginId, $pluginDefinition,
                              MigrationInterface $migration,
                              TermLookupInterface $termLookup) {
    parent::__construct($configuration, $pluginId, $pluginDefinition);
    $this-&gt;migration = $migration;
    $this-&gt;termLookup = $termLookup;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition, MigrationInterface $migration = NULL) {
    return new static(
      $configuration,
      $pluginId,
      $pluginDefinition,
      $migration,
      $container-&gt;get('custom_migrate_tools.term_lookup')
    );
  }

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {

    $contact_info = [];
    if ($label = $this-&gt;configuration['target_label']) {
      $contact_info[0]['first'] = $label;
    }
    else {
      $contact_info[0]['first'] = $label;
    }

    if ($destination_property == 'field_location_taxonomy') {
      $contact_info[0]['second'] = $this-&gt;termLookup-&gt;getTermName($value['target_id'])-&gt;name;
    }
    else {
      $contact_info[0]['second'] = $value['value'];
    }

    if ($targetField = $this-&gt;configuration['target_field']) {
      if ($field_contact_info = $row-&gt;getDestinationProperty($targetField)) {
        array_push($field_contact_info, reset($contact_info));
      }
      else {
        $field_contact_info = $contact_info;
      }
      $row-&gt;setDestinationProperty($targetField, $field_contact_info);
    }
    return $value;
  }

}