I would like to link one contact's address to the main address of a group of many other contacts. I see how to do this manually for one contact, but I cannot find a way to to this in a bulk way for a whole group. Thank you

  • Pls provide a clear example of what you require. I think no one has understood you properly – petednz - fuzion Jun 25 '17 at 4:25

This is how you set the address of all people in a certain group (group id = 13), to be the address of a specific, different contact (address id 15432)

SET @InGroup:=13; SET @MasterAddress:=15432;

UPDATE civicrm_address SET master_id = @MasterAddress WHERE contact_id IN (SELECT contact_id FROM civicrm_group_contact WHERE status = 'Added' AND group_id = @InGroup)

| improve this answer | |

One way you can do this is to use the Advanced Search under the "Search" link on the Civi navigation bar. Expand the Address Fields tab, enter the address. This should produce a list of users with the indicated address. Now you can check all the users and use the dropdown to add them into the group.

| improve this answer | |
  • I don't think you understood what I mean. I have a group of contacts, and I want to set their primary address, of all of them, to the address of another contact's address (the address of the organization they are all part of) – Elad Apr 26 '17 at 9:36
  • 1
    Have you tried the "Import Contacts" under Contacts? If you run identify all the group of contacts that needs their primary address changed, you can setup a spreadsheet with the updated address column and map it. However, I never tried this with data replacement. – Kristine Apr 26 '17 at 19:38

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.