Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to set up autocomplete on a text box using jquery autocomplete with data from an arcserver service. I'm wondering if this is possible and if so how i would implement it. I'm using the esri javascript api v3.3 and arcserver 10.1.

share|improve this question
up vote 5 down vote accepted

Essentially, you are just passing an array to the autocomplete widget. If the data is in a map or feature service, query for the data from the service. If you start with a table in your mxd/msd that contains the data, when you publish it, you will get a REST endpoint for the table to query for in the same way. Next, parse out the data and push onto an array and pass it to the autocomplete widget.

    //build query task
    var queryTask = new esri.tasks.QueryTask("");
    //create an array
    var aStateNames = [];

    //build query filter
    var query = new esri.tasks.Query();
    query.returnGeometry = false;
    query.outFields = ["STATE_NAME"];
    query.where = "OBJECTID > 0";
    queryTask.execute(query, function (results) {
        //parse results and add to autocomplete widget
        dojo.forEach(results.features, function(value, index){
    }, function (error) {
        alert("Error: " + error);
share|improve this answer
Excellent, that works exactly as i wanted. Thanks. – Zachary Mar 7 '13 at 17:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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