5

In my past months learning the ins and outs of Sharepoint, I've had some difficulty finding a really good solution for creating an Autocomplete Lookup. I've explored a couple different options, each with their own drawbacks.

Ideally, an autocomplete lookup should retain all of the functionality of a normal lookup, except that the user inputs data into an INPUT field with autocomplete functionality instead of a SELECT dropdown field.

A couple solutions I've explored so far...

1) Sharepoint 2013 Autocomplete Lookup Field by nadeemyousuf: http://autocompletelookupsp2013.codeplex.com/

This solution adds a new column type specifically for Autocomplete Lookups. This solution accomplishes most of what I want, with one major pitfall: It is not possible to link additional columns from the lookup's source list into the current list. (I'm referring to Sharepoint's "Add a column to show each of these additional fields" option). Although this option appears to be available in the GUI, it has no functionality and the author of the plugin has confirmed that this is a limitation.

2) Using the SPServices JQuery library: http://spservices.codeplex.com/

I found this to be a functional yet inefficient workaround to my dilema with option #1. SPServices has an "autocomplete" function, BUT it can only be applied to "Single line of text" columns. Therefore, I created two separate columns - 1) A single line of text which the user interacts with to select autocomplete data. 2) A lookup column which is invisible to the user; when a selection is made in the autocomplete field, a script fires which makes a selection in the actual lookup. (My script also utilizes the SPDisplayRelatedInfo function to ensure a selection is made by unique ID). This workaround satisfies my requirements, but it is bloated and makes the task of setting up new autocomplete lookups a PAIN. Additionally, we may have multiple instances of large lists being loaded into the invisible lookups and I'm concerned that performance will take a considerable hit.

Any other recommendations?

My hope is that someone can recommend a better solution for me. Maybe there is some way I can improve on the two above solutions? I am open to using a commercial plugin if one exists which is in my budget. I personally don't have any experience creating any custom asp.net solutions, so I'd like to avoid that route if possible.

2
  • converted to a community wiki Commented Jun 23, 2014 at 21:47
  • Did you ever find a better solution?
    – Shayne
    Commented Oct 22, 2015 at 0:30

2 Answers 2

2

using Jquery.

<script language="javascript" src="/JS/jquery-1.6.2.min.js"
type="text/javascript"></script>
<script language="javascript" src="/JS/jquery.SPServices-0.7.2.min.js"
type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $().SPServices.SPAutocomplete({
            sourceList: "Microsoft employees",
            sourceColumn: "Employee",
            columnName: "Employee",
            ignoreCase: true,
            numChars: 2,
            slideDownSpeed: 'fast'
        });
    });</script>

http://www.c-sharpcorner.com/UploadFile/sagarp/fields-autocomplete-for-sharepoint-2010-using-jquery-spservi/

0

I've used jQuery UI on several occasions in conjunction with SPServices to fetch the lookup data.

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.