Magento – customer dataflow advanced profile export retrieve field updated_at in xml action with map name doesn’t work

customerdataflowexportmagento-1

I am trying to export customers and want to export also the field updated_at which is in the table customer_adress_entity.

As in the advanced profile dataflow export there is no choice to choose that field I tried it with the xml actions possibility.

I added the following line

    <map name="updated_at"><![CDATA[updated_at]]></map>

but an empty value is the result. Even if there are values in the table.

Best Answer

So from what I can see the customer dataflow will not export system fields. If you look into the class app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php you can see the function unparse. This converts the data into the csv rows.

At the very beginning of this method it loads all the system fields as defined in the xml app/code/core/Mage/Customer/etc/config.xml see node admin->fieldsets->customer_dataflow.

$systemFields = array();
foreach ($this->getFields() as $code=>$node) {
    if ($node->is('system')) {
        $systemFields[] = $code;
    }
}

Then during the parsing process the system will look through the customer data and process the data that it would like to export. The problem is that it will skip all data fields flagged as system.

if (in_array($field, $systemFields) || is_object($value)) {
    continue;
}

So you could do one of the following options:

  1. Update the xml nodes so that updated_at is not a system field,
  2. Update the unparse so that you can select some system fields to export,