I'm exporting contacts with both home and billing addresses, where the home address is set as primary. Even though I've selected primary as the address type for all address fields in the export fields selection, some of the fields in the export are actually the billing address (which is definitely not set as the primary address).

Has anyone else run into this or does anyone know why this might be happening?

It's hard to tell exactly how many contacts this is happening to, but it does seem to be a significant number. I have not been able to replicate the issue on the demo site.

5.7.6 on Drupal.

  • I'd start by looking at the errors and seeing if there's a pattern.
    – Alan Dixon
    Sep 5, 2019 at 13:33
  • So far, all the errors I can find involve contacts with a non-primary billing address with no province/state. Also, I'm seeing that the displayed address in the group listing is also showing the non-primary billing address. Adding the province/state does not fix the problem.
    – Lars SG
    Sep 5, 2019 at 15:50
  • Have found some counter examples, there are contact with missing province/state in the non-primary billing address that export correctly and there are contact the export incorrectly that have the correct province/state in the billing address. Still seems like missing province/state is found along with this error most of the time.
    – Lars SG
    Sep 5, 2019 at 17:11

2 Answers 2


It turns out that the "Search Primary Details Only" setting causes this problem (found under Administer-> Customize Data and Screens-> Search Preferences). It seems that if this setting is off, the listings and export will default to the address which was created earlier.

See here for details: Contact Search Results Address Type

This is a weird behaviour in the listings, but for the exports seems like a bug as selecting primary address types in an export does not return primary addresses.


The export issue is actually a confirmed bug, see https://lab.civicrm.org/dev/core/issues/464 I have had moderate success using hook_civicrm_export in a custom extension for a client where email location type is really important to their workflow.

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.