1

I've recently imported about 10,000 records into our database, many of them adding an additional work email address to our existing contacts whose home email address we used to contact.

When the new work addresses were imported, it seems that many/most contacts now have their new work email as their primary.

Is there any way to change the users' primary email to their home one, en masse?

1

Yes, making use of the api you can change more or less any data. Test it by accessing the api explorer under <your_installation>/civicrm/api.

  1. First check getting emails in question.
  2. Then try out setting parameters like you want.
  3. Combine the calls to either a php script or use api chaining in the api explorer.

Keep in mind that get operations are limited to 25 results by default and that update operations may harm your data – even in the api explorer.

If you have questions consider Using the API or ask here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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