0

I was wondering if there is a way to get an autocomplete text field in a New Task Form that renders the 'Title' column from each of the (10) lists/document libraries in my SharePoint App. Currently, I have a working autocomplete text field that renders (1) list -- can this be altered to render ALL ten of my lists/libraries?

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.01/jquery.SPServices.min.js">
<script src="/cdnjs.cloudflare.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.2/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
    $().SPServices.SPAutocomplete({
        sourceList: "LibraryOne",
        sourceColumn: "Title",
        columnName: "DocumentId",
        ignoreCase: true,
       filterType: "Contains",
        numChars: 3,
        slideDownSpeed: 'slow'
        });
    });
</script>

For those interested, I am using this as a dynamic 'attach a document' feature in a New Task Form. The user opens a new task form and begins typing the name of the document that they would like to attach. After the new form is submitted, a workflow finds the url column by matching the title column to the source document list, returning the url in a hyperlink.

Any help is appreciated!

1

The SPServices library does not provide cross lists query with OOB functions.

You would create a list view on the server that performs the list aggregation so you could read by SPServices library or query items by REST API and combine the items as one data source, then achieve auto complete by jQuery autocomplete.

https://jqueryui.com/autocomplete/

  • Thanks for the response. I'm kind of new to this -- I've looked through the literature on the jquery site, but having trouble figuring out how to structure the autocomplete to include multiple lists. – TheJDScott Nov 14 '17 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.