Answers.Body: <p>I believe the External ID is a single value field. On clicking help you'll see: "Use this field to store a unique identifier. This is generally used to link contacts with records in a related or legacy application...."</p>
  
  <p>As you suggested a custom field might be needed, perhaps you can use a multi-value custom field, and move all your external ids to this new custom field.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-20T17:57:53.797Z
Answers.Text: Sanjay - it's a unique ID. But I was just able to make the External ID in my own record this - 123456 | 78910 . So I can have records with these two unique External IDs that I can search for and find. Obviously if there are imports/exports back and forth using External ID this won't work - but for simply storing External IDs used in an old legacy system for reference, having two old External IDs stored in the same record is doable.
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-20T17:08:18.563Z
Answers.LastActivityDate: 2015-10-20T17:08:18.563Z
Answers.UserDisplayName: Sanjay Jain
Answers.Body: <p>It all depends on what you plan on doing with the External ID.  Its suggested use is to use it to match on imported contributions and other transactional data.  If that's your use case, then a single value probably makes the most sense. </p>
  
  <p>It's also useful for just referencing back to some prior legacy data. Here a single value probably makes the most sense, though on a manual basis multiple values would probably work using delimiters as outlined in other answers.</p>
  
  <p>Interestingly, if you are doing custom development (and I don't know why you wouldn't use a custom data field for it) you can put anything in the External ID field.  For instance on the CiviCRM sandbox I was able to enter in a bit of json formatted values which could be used programmatically.  (JSON is a standard for formatting data values, ie <code>{"source": "sheet12","row": "22"}</code>. This example might be used to reference back to a row in a spreadsheet.)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-20T20:12:45.247Z
Answers.LastActivityDate: 2015-10-20T20:12:45.247Z
Answers.UserDisplayName: DaveD
Answers.Body: <p>If you don't have a lot of these - simply add the second External ID to the merged record manually, and separate the values with a non-numeric character like - or | - then you can search using Search Builder or in the back end (using PHPMyAdmin) or in the API Explorer for values with - or |, and/or use the % "wild card" in searches, like %[second External ID value]%. This assumes the External ID field doesn't allow only numeric values but any text string - I'm not sure about that.</p>
  
  <p>If you do have a lot of  these - export the current and deleted/merged records as .csv, match up the two sets of records by first name and last name, say, then concatenate the values of the two External IDs into a new column/field using that function in Excel, Google Sheets, or with a query using MS Access, MySQL, whatever. Then import and update the External IDs for the records that you are keeping, matching on import using the kept record's Internal Contact ID, Civi's unique ID for that person.    </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-20T17:42:57.220Z
Answers.LastActivityDate: 2015-10-20T17:50:17.173Z
Answers.LastEditDate: 2015-10-20T17:50:17.173Z
Answers.UserDisplayName: Joe McLaughlin
Answers.Body: <p>The External ID field isn't just a regular field--it allows matching by ID alone.  It would be a waste to have External ID be concatenated fields, for a couple of reasons:</p>
  
  <ul>
  <li>You can't search easily.  If you have a contact with an ID from System 1 of "123" and an ID from System 2 of "789", and you concatenate with a "|", you'd have a value of "123|789".  If you search for an External ID of "%123%", you'd catch "123|789" as well as "222|123" (i.e. the record with ID 123 in System 2) and "1123|789" (i.e. any ID with those digits in order, regardless of position).</li>
  <li>You lose auto-matching on import.  If you're doing a later import from the external system, you won't be able to identify the External ID and have it match.  You'll need to use a matching rule or the CiviCRM ID.  This makes it no better than a regular custom field.</li>
  <li>You may have trouble importing in the first place.  If you're importing from System 1, you'll know that system's external ID, but you might not know the corresponding contact's ID in System 2.  You'd need to do some spreadsheet tricks like Joe suggests, and you'd have to match up the two systems' records in the spreadsheet before you even start.</li>
  <li>You'll never be able to merge records reliably.  If Sammy is ID 123 in System 1 and Samuel is ID 789 in System 2, you might not catch that they're the same guy.  They might end up as separate contacts in CiviCRM, but when you merge them, you'll only be able to concatenate the IDs by remembering the one that gets lost and going back to edit the External ID manually.</li>
  </ul>
  
  <p>All in all, there's no advantage to cramming multiple values into the External ID field, and it has distinct disadvantages (merging and searching, in particular) as compared to regular custom fields.  You should simply decide that one system's ID is the External ID and the others are custom fields.  If it would be ambiguous, make them all custom fields; that's still better than mixing up the External ID field.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-21T01:49:11.663Z
Answers.LastActivityDate: 2015-10-21T01:49:11.663Z
Answers.UserDisplayName: Andie Hunt
Body: <p>I would like to add multiple values in External ID.  Is this possible or would I have to create a new custom field?</p>
  
  <p><strong>Example
  2 Duplicate contacts have different external IDs.  I want to merge them but keep both external ids.</strong></p>
  
  <p>Thanks</p>
  
Tags: <contacts><import><duplicate-contacts>
Title: Can the External ID have multiple values
ThreadText: # Can the External ID have multiple values
  
  (Asked by: username_0 on 2015-10-20)
  
  I would like to add multiple values in External ID. Is this possible or would I have to create a new custom field?
  
  **Example
  2 Duplicate contacts have different external IDs. I want to merge them but keep both external ids.**
  
  Thanks
  
  **Tags:** contacts, import, duplicate-contacts
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_4 on 2015-10-21. Score: 8 | Accepted answer
  
  The External ID field isn't just a regular field--it allows matching by ID alone. It would be a waste to have External ID be concatenated fields, for a couple of reasons:
  
  * You can't search easily. If you have a contact with an ID from System 1 of "123" and an ID from System 2 of "789", and you concatenate with a "|", you'd have a value of "123|789". If you search for an External ID of "%123%", you'd catch "123|789" as well as "222|123" (i.e. the record with ID 123 in System 2) and "1123|789" (i.e. any ID with those digits in order, regardless of position).
  * You lose auto-matching on import. If you're doing a later import from the external system, you won't be able to identify the External ID and have it match. You'll need to use a matching rule or the CiviCRM ID. This makes it no better than a regular custom field.
  * You may have trouble importing in the first place. If you're importing from System 1, you'll know that system's external ID, but you might not know the corresponding contact's ID in System 2. You'd need to do some spreadsheet tricks like Joe suggests, and you'd have to match up the two systems' records in the spreadsheet before you even start.
  * You'll never be able to merge records reliably. If Sammy is ID 123 in System 1 and Samuel is ID 789 in System 2, you might not catch that they're the same guy. They might end up as separate contacts in CiviCRM, but when you merge them, you'll only be able to concatenate the IDs by remembering the one that gets lost and going back to edit the External ID manually.
  
  All in all, there's no advantage to cramming multiple values into the External ID field, and it has distinct disadvantages (merging and searching, in particular) as compared to regular custom fields. You should simply decide that one system's ID is the External ID and the others are custom fields. If it would be ambiguous, make them all custom fields; that's still better than mixing up the External ID field.
  
  
  ---
  
  ### Answer by username_1 on 2015-10-20. Score: 2
  
  I believe the External ID is a single value field. On clicking help you'll see: "Use this field to store a unique identifier. This is generally used to link contacts with records in a related or legacy application...."
  
  As you suggested a custom field might be needed, perhaps you can use a multi-value custom field, and move all your external ids to this new custom field.
  
  > **Comments:**
  > **username_2**: username_1 - it's a unique ID. But I was just able to make the External ID in my own record this - 123456 | 78910 . So I can have records with these two unique External IDs that I can search for and find. Obviously if there are imports/exports back and forth using External ID this won't work - but for simply storing External IDs used in an old legacy system for reference, having two old External IDs stored in the same record is doable.  
  
  ---
  
  ### Answer by username_3 on 2015-10-20. Score: 2
  
  It all depends on what you plan on doing with the External ID. Its suggested use is to use it to match on imported contributions and other transactional data. If that's your use case, then a single value probably makes the most sense.
  
  It's also useful for just referencing back to some prior legacy data. Here a single value probably makes the most sense, though on a manual basis multiple values would probably work using delimiters as outlined in other answers.
  
  Interestingly, if you are doing custom development (and I don't know why you wouldn't use a custom data field for it) you can put anything in the External ID field. For instance on the CiviCRM sandbox I was able to enter in a bit of json formatted values which could be used programmatically. (JSON is a standard for formatting data values, ie `{"source": "sheet12","row": "22"}`. This example might be used to reference back to a row in a spreadsheet.)
  
  
  ---
  
  ### Answer by username_2 on 2015-10-20. Score: 2
  
  If you don't have a lot of these - simply add the second External ID to the merged record manually, and separate the values with a non-numeric character like - or | - then you can search using Search Builder or in the back end (using PHPMyAdmin) or in the API Explorer for values with - or |, and/or use the % "wild card" in searches, like %[second External ID value]%. This assumes the External ID field doesn't allow only numeric values but any text string - I'm not sure about that.
  
  If you do have a lot of these - export the current and deleted/merged records as .csv, match up the two sets of records by first name and last name, say, then concatenate the values of the two External IDs into a new column/field using that function in Excel, Google Sheets, or with a query using MS Access, MySQL, whatever. Then import and update the External IDs for the records that you are keeping, matching on import using the kept record's Internal Contact ID, Civi's unique ID for that person.
  
  
  ---
  
  