AnsweredAssumed Answered

How to Query a flat table in JavaScript API

Question asked by shaikhrizuan on Aug 22, 2016
Latest reply on Aug 22, 2016 by shaikhrizuan

Hi,

 

I want to query a flat table present in SQLdatabase from JavaScript API. I have published the map service including the flat table and got the REST URL. When i query the table, i am not able to see any field attributes or values. Below is the code:

 

var queries = [];
var queryTask = new QueryTask("https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer/3");
var query = new Query();
query.where = "OBJECTID = 4";
query.outFields = ["TABLENAME", "FIELDNAME", "VALUEINFO"];
query.returnGeometry = true;
queries.push(queryTask.execute(query));
var iPromises = new all(queries);
iPromises.then(lang.hitch(this, function (r) {
      r.length // coming length as One but not able to see field values
}
}));

Also find screen-shot for the same:

Screenshot

Any idea.. how to get the field values.???

 

Regards,

Shaikh Rizuan

Outcomes