AutoComplete Source from API

Forums Autocomplete AutoComplete Source from API

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 2 months, 3 weeks ago.

  • Author
  • #25436



    I’m wondering if it would be possible to use AutoComplete with a datasource of an external REST API instead of a SharePoint list? If not I’ll go down the jQuery UI AutoComplete path but I like yours better.

    • This topic was modified 2 months, 3 weeks ago by  Kasey. Reason: Wrong forum
  • #25462

    Alexander Bautz

    I haven’t added any official method to override this, but you can hack it by overriding the default function for getting the items like this:

    // Copy default function =;
    // Override default function = function (argObj) {
        // Add your custom code here and ensure the output is in this format - including the fields you have specified as "ShowField", "SearchField" and "optionDetailFields":[argObj.applyTo] = {
            "done": true,
            "items": [
                    "ID": 1,
                    "Title": "Item 1"
                    "ID": 2,
                    "Title": "Item 2"
        setTimeout(function () {
            jQspjs("#spjs_acspinner_" + argObj.applyTo).hide().next().show();
   = new Date().valueOf();
        }, 100);

    This function must be placed ABOVE the call to{…}); and you must use the following settings:


    If you use autocomplete for other fields and want to use the built in function for those, you must reset the function back to the default after you have finished calling the one using the custom function – do it like this:

    // Reset default function =;

    Let me know how this works out.


You must be logged in to reply to this topic.