Combine multiple sources into a field I have multiple sources which roughly looks like: 


Wines - Contents: "1,2,3,4"
Sodas - Contents: "1,2,3,4,5"


I'd like to combine those into one taxonomy vocabulary, get them to be auto-created and referenced in the destination field. So I'd like to do something like the following. But, if I read the static_map documentation correctly, mapping multiple sources like this is not the way it works. Also, I'm not yet exploding the string in the example, which I think is mandatory to be able to map the values.

  field_drinks:
    - 
      plugin: static_map
      source: 
        - wines
        - sodas 
      map: 
        wines:
          '1': 'Sauvignon Blanc'
          '2': 'Chiraz'
          '3': 'Pinot Noir'
          '4': 'Malbec'
        sodas:
          '1': 'Coca-Cola'
          '2': 'Spa'
          '3': 'Sprite'
          '4': 'Tonic'
          '5': 'Bitter lemon'
    -
      plugin: skip_on_empty
      method: process
    -
      plugin: entity_generate
      entity_type: taxonomy_term
      bundle_key: vid
      bundle: drinks
      value_key: name


How do I convert this to suit my needs?
Found it out after a lot of trial and error. Basically it comes down to breaking everything up into individual "pseudo fields" and prepare the data before processing it into the actual field:

process: 
  # First convert legacy wine id's to regular string names in a pseudo field
  _prepare_wines: 
    -
      plugin: explode
      limit: 100
      delimiter: ","
      source: wines
    -
      plugin: static_map
      map:
        '1': 'Sauvignon Blanc'
        '2': 'Chiraz'
        '3': 'Pinot Noir'
        '4': 'Malbec'

  # Secondly convert legacy soda id's to regular string names in a pseudo field
  _prepare_sodas: 
    -
      plugin: explode
      limit: 100
      delimiter: ","
      source: sodas
    -
      plugin: static_map
      map:
        '1': 'Coca-Cola'
        '2': 'Spa'
        '3': 'Sprite'
        '4': 'Tonic'
        '5': 'Bitter lemon'

  # Third, get all the pseudo field output together in a new pseudo field and flatten them into a single array
  _prepare_field_drinks:
    - 
      plugin: get
      source:
        - '@_prepare_wines'
        - '@_prepare_sodas'
    -
      plugin: flatten

  # Lastly, the data is now all in a nice single level array with only names for the new taxonomy terms so we can use those as source.
  field_drinks:
    -
      plugin: entity_generate
      entity_type: taxonomy_term
      bundle_key: vid
      bundle: drinks
      value_key: name
      source: '@_prepare_field_drinks'


Disclaimer: I'm not sure if this is the way it should be handled, but it seemed to do the trick without any custom plugins. Also, please be aware that if any of the source fields can be empty, you should prepend a skip_on_empty plugin to make sure your rows will not be ignored.