With thanks to John Gravois, I've been able to pass geometry from the result of a geocoder, along with a field name, to a spatial intersection query to run against a school boundary layer.
What I'd like to do is pull the school boundary number from the corresponding field the user chooses - that is - the user chooses Grade 6 from the drop down, which means I want the value from the SCHOOL_6 field in the boundary layer I'm querying.
So I'm wondering how I should do this:
1) Do I use the SCHOOL_6 value in the outfields query parameter and pull that value, which yields this result:
additionally - how do I pull that value 416 if there is only ever 1 feature returned, but the field name could always change based on the drop-down?
2) Pull all the fields from the query layer, and select the attribute from the field that matches the value of the drop-down (ie. SCHOOL_6), and sift through the results that way. Here's what the results look like from pulling all the fields:
The purpose of pulling this boundary number is that it will go into the last query, which will pull all the schools belonging to that boundary number.
UPDATE: I have added the code I am working on. cc Jake Skinner
Any thoughts appreciated.
Message was edited by: Matthew Baker