4

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

2
  • 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? Commented Oct 17, 2016 at 4:00
  • @JonG, duly updated! To clarify also - I've revamped my setup since posting, and I'm not getting any results whatsoever now.
    – termdark
    Commented Oct 17, 2016 at 18:25

2 Answers 2

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

2
  • Is this all it took or were there additional commits? I need the External ID search... github.com/colemanw/webform_civicrm/commit/…
    – Laryn
    Commented Sep 12, 2018 at 22:06
  • 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 Commented Sep 12, 2018 at 23:08
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).

3
  • 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.
    – termdark
    Commented Sep 15, 2016 at 21:39
  • 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? Commented Sep 15, 2016 at 21:45
  • The user record does have them, but the surveys are already printed and completed - and helpfully don't have it on there!
    – termdark
    Commented Sep 18, 2016 at 17:45

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.