1
  1. Is External ID Unique? will it automatically check for a duplicate External ID when the attempt is made to enter into database?

  2. Can External ID be auto incremented whenever an individual gets added?

1 Answer 1

4

The External ID (external_identifier) is maintained in the database with a unique index, so any attempt to enter a duplicate value will take an error.

The external_identifier itself is simply a variable character string of 64 char in length (varchar(64)). As such it cannot auto-increment.

Remember, the external_identifier is designed to contain an identifier of the contact that might originate in a separate system. In practice, it is most common to use it when migrating from some other CRM system into CiviCRM, wherein the other systems identifier is stored in the External ID. This can be invaluable for audit purposes.

If you are looking for an auto-incremented identifier, you should consider using the contact_id.

2
  • thank you for the answer. For my organization, I want to store data of visitors, students, professors, scientists, members. While members have ID's in our previous system, others don't carry any such IDs. I am caught up between whether to use External ID to store the previous system ID or to create a custom field under civiMember? any suggestions? Commented Jun 17, 2017 at 3:41
  • Without knowing your particulars, I would suggest that you store the previous system ID in the External ID. That's really what it's for. Everything else should fit nicely into custom data sets I imagine. The only gotch is probably if you have different identification systems across the various originating data sources. Then, it usually helps to add a prefix to the external id to make it unique, but still auditable.
    – DaveD
    Commented Jun 19, 2017 at 12:58

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.