Query by attribute?
Greetings!
I need a clue as to how to select a feature via the attribute value of another selected feature.
I have a workflow that does the following:
1. Selects an address point from user input
2. Then highlights the voter precinct (poly) that contains the address point.
Next, I need to select the poll location (point) for that selected voter precinct. However, poll locations are not necessarily within voter precincts – sometimes they are in other precincts – so I need to select the poll location based upon the precinct ID attribute of the selected precinct (the precinct ID is also in the poll locations).
Can anyone give me a clue? Or share a workflow that does something similar? Or point me to a post that may already answer that question?
Many thanks in advance!
0
-
Hi Lisa,
I think you could use a Query Task. In "Query Service URL" you can set your "poll location layer URL" and in "Where" you can set "PrecinctId='123' " (where 123 is replaced with the Id that you are looking for). No need to set a "geometry" value but probably you would like to set "Return Geometry" = True to see the results in the map. The "Result" is going to be a feature set that can be used to display results or for following operations.
?I hope this helps0 -
I really appreciate your time, Francesca!
I'm not sure how to structure the 'Where' clause so that it references any precinct/precinct id that has been selected through a previous query. In other words, My Where clause needs to be something to the effect of "PollLocation PrecinctId = any result of a PrecinctQuery' ". I need to use the resulting attribute value from a previous query for the input. Does that make sense?
Again, I truly appreciate any light you can shed on this!0 -
Sorry,
I cannot open your workflow but you can use:
'&' operator instead of '+'
or
string.format("PrecinctId = {0}",voterPrecinctPolyId)0 -
Thank you, Francesca! Turns out the WHERE clause needed a little tweaking, but it works now!
"PRECINCTID like '%" + voterPrecinctPolyId +"%' "0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
4 kommentarer