Skip to content

Instantly share code, notes, and snippets.

@heitoralthmann
Created April 29, 2020 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heitoralthmann/2dca9e35ac84ec6c263112c11646670f to your computer and use it in GitHub Desktop.
Save heitoralthmann/2dca9e35ac84ec6c263112c11646670f to your computer and use it in GitHub Desktop.
Drupal 8 migrate: Using sub_process with entity_generate/entity_lookup: Looping through source field values and creating taxonomy terms for each of them.
# Looping through source field values and creating taxonomy terms for each of them (bundle_key and value_key are both required in this scenario)
field_name:
-
plugin: skip_on_empty
method: process
source: 'Source-Field-Name'
-
plugin: sub_process
process:
target_id:
plugin: entity_generate
bundle: vocabulary_id
value_key: name
bundle_key: vid
source: 'Looping-Item-Property-Name'
entity_type: taxonomy_term
ignore_case: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment