I’ve created a Feeds importer for a commerce product variation type. The product type is a commerce mp3 file. In it’s content type the mp3 refers to an album product. So in the Feeds mapping there is a target that reads ‘Album reference (Entity reference by Entity ID)’.

so far nothing has worked to get the mp3 product to refer correctly to it’s album reference. The album btw, is also a commerce product.

In my latest test example, the album name is ‘So Open’. I confess i’m not clear exactly on what an Entity ID is?! In looking at the Album on it’s Devel page i see the vid and nid are both 626.

my attempts have include the following: ’So Open’ -> error, So Open (no quotes) -> error 626.

This latter 626 does not generate an error but also does not populate the field correctly once the product is created. That ref. is simply left blank.

Perhaps the problem is I don’t understand what an Entity ID really is.

Does anyone know what i should be putting there? and how to find out that product’s Entity ID?

1 Answer 1


Might be important: Are the product displays (the albums) already in the site or are you importing those as well?

Entity IDs are generic unique identification numbers that entities use to reference each other. Nodes are a certain kind of entity and their id is "Node ID" but you are looking for the Product ID, which, Kickstart 2 does a really good job of hiding from the site builder. Try going to admin/commerce/products/variations to see all your products and when you click edit on one, the number in the url is your entity id for that product.

So, when you create an album with mp3s, the structure looks like this:

Album (node id: 123)
  |__ commerce_product (field), Value: 23,24,25

MP3-1 (product id: 23)
MP3-2 (product id: 24)
MP3-3 (product id: 25)

All of the "id"s are entity ids.

Regardless, you can use the entity field query finder function of the feeds_tamper module to locate an entity reference while importing a CSV using Feeds.

  • 1
    thanks, yes album products and albm product displays are already on the website.
    – TopTomato
    Jan 28, 2016 at 20:00
  • 1
    def a knowledge gap in understanding Drupal Entities, i've Googled and looked around before but not much came up,
    – TopTomato
    Jan 28, 2016 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.