Answers.Body: <p>For a large org who also could not use any Name autocomplete (just too many Contacts) - I create a Enter Contact ID Form Widget (for _contact_existing). If you adapt your processes to do lookup by Contact ID - this new Widget is in current versions of Webform CiviCRM module. If you continue to want to lookup by External ID - have a look at the code and mimic it after this example or alternatively sponsor a bit of time and we'll be happy to get that done for you. </p>
  
  <p><a href="https://i.sstatic.net/HSLF7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HSLF7.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T22:06:33.673Z
Answers.Text: Is this all it took or were there additional commits? I need the External ID search... https://github.com/colemanw/webform_civicrm/commit/45a5934dbd4f7609f535f8642f933932639c0c64
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T23:08:07.343Z
Answers.Text: Yep that was it - in your case it will be a little bit more work as you need to map external contact id to internal contact id
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-08T14:31:15.513Z
Answers.LastActivityDate: 2018-09-08T14:31:15.513Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>Not sure of the answer to that exact question, but: why not include both Display Name (first name, last name) or Sort Name (last name, first name) as well as External ID in the lookup for Existing Contact? Then, the user can search by name, and choose the correct record based on External ID (if there is more than one user with the same name). </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-15T21:39:01.037Z
Answers.Text: Thanks for the reply. The exact use case is for data entry of paper surveys, which have the external ID and email address on them - not the name. For the moment, we're able to use the email address to match the survey to their contact record, but while all surveys included the external ID, some skipped the email address and others will inevitably have a different email to the one on file.
Answers.UserDisplayName: termdark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-15T21:45:53.447Z
Answers.Text: Ah - but does the *user record* have first and last names, which can be used for the lookup? Is the survey supposed to be anonymous?
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-18T17:45:01.267Z
Answers.Text: The user record does have them, but the surveys are already printed and completed - and helpfully don't have it on there!
Answers.UserDisplayName: termdark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-15T20:48:36.013Z
Answers.LastActivityDate: 2016-09-15T20:48:36.013Z
Answers.UserDisplayName: Joe McLaughlin
Body: <p>I have a webform set up with a contact autocomplete box, searching using the external ID. Our external IDs are in the format ec1234567.</p>
  
  <p>The problem I have is that when searching for a contact, it starts to autocomplete on the first character 'e' (and shows the results as it should), but when entering the second character 'c' and subsequent digits, it shows no results, only the 'create contact' option.</p>
  
  <p>Does anyone have any ideas why this might be, and what could be done to make it search for the full external ID?</p>
  
  <p><a href="https://i.sstatic.net/QJnqL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QJnqL.png" alt="screenshot of component settings"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-17T04:00:12.353Z
Comments.Text: I tried quickly replicating your setup so I could look at the Network control panel for clues.  However, I couldn't figure out (but am VERY interested) in how you set up a webform that searched by external ID!  By coincidence I need similar functionality.  Could you please update the question with a screenshot so I can do tests on a similar setup?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-17T18:25:23.353Z
Comments.Text: @JonG, duly updated! To clarify also - I've revamped my setup since posting, and I'm not getting any results whatsoever now.
Comments.UserDisplayName: termdark
Tags: <drupal><webform-civicrm>
Title: Webform contact autocomplete only searches the first character of external ID
ThreadText: # Webform contact autocomplete only searches the first character of external ID
  
  (Asked by: username_0 on 2016-09-15)
  
  I have a webform set up with a contact autocomplete box, searching using the external ID. Our external IDs are in the format ec1234567.
  
  The problem I have is that when searching for a contact, it starts to autocomplete on the first character 'e' (and shows the results as it should), but when entering the second character 'c' and subsequent digits, it shows no results, only the 'create contact' option.
  
  Does anyone have any ideas why this might be, and what could be done to make it search for the full external ID?
  
  [![screenshot of component settings](https://i.sstatic.net/QJnqL.png)](https://i.sstatic.net/QJnqL.png)
  
  **Tags:** drupal, webform-civicrm
  
  > **Comments:**
  > **username_1**: I tried quickly replicating your setup so I could look at the Network control panel for clues.  However, I couldn't figure out (but am VERY interested) in how you set up a webform that searched by external ID!  By coincidence I need similar functionality.  Could you please update the question with a screenshot so I can do tests on a similar setup?  
  > **username_0**: @JonG, duly updated! To clarify also - I've revamped my setup since posting, and I'm not getting any results whatsoever now.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-09-08. Score: 1
  
  For a large org who also could not use any Name autocomplete (just too many Contacts) - I create a Enter Contact ID Form Widget (for \_contact\_existing). If you adapt your processes to do lookup by Contact ID - this new Widget is in current versions of Webform CiviCRM module. If you continue to want to lookup by External ID - have a look at the code and mimic it after this example or alternatively sponsor a bit of time and we'll be happy to get that done for you.
  
  [![enter image description here](https://i.sstatic.net/HSLF7.png)](https://i.sstatic.net/HSLF7.png)
  
  > **Comments:**
  > **username_3**: Is this all it took or were there additional commits? I need the External ID search... https://github.com/colemanw/webform_civicrm/commit/45a5934dbd4f7609f535f8642f933932639c0c64  
  > **username_2**: Yep that was it - in your case it will be a little bit more work as you need to map external contact id to internal contact id  
  
  ---
  
  ### Answer by username_4 on 2016-09-15. Score: 0
  
  Not sure of the answer to that exact question, but: why not include both Display Name (first name, last name) or Sort Name (last name, first name) as well as External ID in the lookup for Existing Contact? Then, the user can search by name, and choose the correct record based on External ID (if there is more than one user with the same name).
  
  > **Comments:**
  > **username_0**: Thanks for the reply. The exact use case is for data entry of paper surveys, which have the external ID and email address on them - not the name. For the moment, we're able to use the email address to match the survey to their contact record, but while all surveys included the external ID, some skipped the email address and others will inevitably have a different email to the one on file.  
  > **username_4**: Ah - but does the *user record* have first and last names, which can be used for the lookup? Is the survey supposed to be anonymous?  
  > **username_0**: The user record does have them, but the surveys are already printed and completed - and helpfully don't have it on there!  
  
  ---
  
  