0

I have a couple of CiviCRM integrated webforms with 'existing contact' enabled, using the autocomplete option. My problem is that the fields only return the first 12 matching records, even when there are more matches.

For example our DB has 27 records with 'University' in their names. If a user enters 'University' the dropdown lists the first 12 records (Botswana University; Cambridge University etc). To return 'University of Zululand' users need to enter 'University of Z', but this isn't obvious to the user

Is it possible to increase the number of existing contact results returned, and if so where?

Alternately has anyone found a different way around the problem e.g. would it be possible to add a "click for more results" at the bottom of the dropdown list?

(We are using Drupal 7.82; Webform 7.x-4.24; Webform CiviCRM Integration 7.x-5.6)

4
  • Just a wild guess but there is a setting at the bottom of this page that could do that: .../civicrm/admin/setting/search?reset=1 . But maybe it only refers to CiviCRM's "autocomplete fields".
    – Fabian
    Commented Sep 30, 2021 at 12:46
  • Thanks Fabian - I tried that first but it didn't work. Fortunately Kainuk had the answer.
    – Davy Ivins
    Commented Sep 30, 2021 at 16:14
  • if you were searching for 'University of Zululand' do you get a result by just searching for 'zulu'?
    – petednz - fuzion
    Commented Sep 30, 2021 at 20:14
  • Hi Pete - yes 'zulu' works.
    – Davy Ivins
    Commented Oct 1, 2021 at 6:52

1 Answer 1

1

The limit of 12 is hard-coded in the webform_civicrm module. You can find the line here

https://github.com/colemanw/webform_civicrm/blob/8276d951fc1ab00e3b6b989fb3f2b594d41ba3a9/includes/contact_component.inc#L669

The most crude way to change it is to edit the source code. You will lose this change the next time the webform_civicrm module on the site is updated.

If you are a developer, you can make the limit configurable and submit a PR to the Drupal project.

Or add some instructions for your user, explaining the first twelve results are shown, so it is better to be specific.

1
  • That's exactly what I needed. Thanks!
    – Davy Ivins
    Commented Sep 30, 2021 at 16:13

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.