Extract final value from nested field collection I have a content type with a field collection. This field collection has, as fields, other field collections. It works well, it groups the content for a node perfectly, but when trying to extract the data programmatically, I cannot access the values introduced. How would be the method. I tried with this piece of code, but it throws an error. Also not sure if adequate to my case (nested field collections):

$node = node_load($node-&gt;nid);
$node_wrapper = entity_metadata_wrapper('node', $node);

foreach ($node_wrapper-&gt;field_rich_text_group as $field_collection_wrapper) {
            $field_collection = $field_collection_wrapper-&gt;value();
                print_r($field_collection);
}
Try this :

$node = node_load($node-&gt;nid);
$node_wrapper = entity_metadata_wrapper('node', $node);

foreach ($node_wrapper-&gt;field_rich_text_group-&gt;value() as $value) {
  $field_collection_wrapper = entity_metadata_wrapper('field_collection_item', $value);
  $field_collection_myfield = $field_collection_wrapper-&gt;field_myfield-&gt;value();
  print_r($field_collection_myfield);
}


Field Collection is an entity, so if you want to access its field you have to pass the field collection in entity_metadata_wrapper. Then you can access the value of your fields in field collection like you do with your $node_wrapper