danieto

query.outFields gives wrong result

Discussion created by danieto on Jul 13, 2011
Latest reply on Jul 13, 2011 by stevel
I need a query to give me an out field that is also part of the where query is this possible?

                smQueryTask= new esri.tasks.QueryTask("/arcgis/services/serverlocation");
                smQuery = new esri.tasks.Query();
                smQuery.returnGeometry = true;
                smQuery.outFields = ['Mile Value']; <-this is the value i want
                smQuery.where = locationsQuery; <- it also happens to be a field in the where(which works fine i.e. where ['Mile Value'..])
    
  console.log(smQuery); <-this is for debugging where i see the wrong values
                drawQueryThings();
........
// draw all locations
function drawQueryThings() {
    // execute query task
   console.log("Drawing QueryObjects");

    smQueryTask.execute(smQuery, function(drawAllQueryResults) {
            for (var i = 0 l = drawAllQueryResults.features.length; i < l; i++) {
   console.log(drawAllQueryResults.features[i]); <-no features in there except for a completely unrelated attribute
...
}


Here are the values from firebug
1. outFields ["Mile Value"]
0"       Mile Value"
2. undefined.

hopefully this makes a little sense to somebody what I am trying to accomplish.

Outcomes