Select to view content in your preferred language

Query Service via user input

1543
5
Jump to solution
03-29-2017 12:45 PM
jaykapalczynski
Frequent Contributor

Are there any examples out there showing how to Query a Service via User input and return results to a table?  AND have that table interact with the map features.  Click the map and it highlights in the table and visa versa

Example:

1 drop down box for County

1 text field year

User specifies parameters and then on submit the table updates and the features are rendered in the map

0 Kudos
1 Solution

Accepted Solutions
Drew
by
Regular Contributor

Its not exactly what you want but ESRI does have a sample of how to query without a map

Query data without a map | ArcGIS API for JavaScript 3.20 

Drew

View solution in original post

0 Kudos
5 Replies
Drew
by
Regular Contributor

Its not exactly what you want but ESRI does have a sample of how to query without a map

Query data without a map | ArcGIS API for JavaScript 3.20 

Drew

0 Kudos
jaykapalczynski
Frequent Contributor

Yea was messing around with that but cant figure out where they are specifying what Field to query from the stateName textbox

0 Kudos
jaykapalczynski
Frequent Contributor

Any ideas on how to modify this to include more than one input parameter?

function execute () {
       alert("Execute");


      query.text = dom.byId("CountyName").value;

      query.text = dom.byId("Squad").value;


      queryTask.execute(query, showResults);
}

0 Kudos
jaykapalczynski
Frequent Contributor

Trying this but no cigar

var CountyName = (dom.byId("CountyName").value);

// THIS WORKS BUT need a variable

//query.where = "County_Nam = 'Accomack' AND Squad = '13'";

query.where = "County_Nam = '+ CountyName +' AND Squad = '13'";

0 Kudos
Drew
by
Regular Contributor
0 Kudos