Trouble Connecting SearchForm Result to Zoom To Feature
Hi, I'm trying to configure a simple Address search workflow that queries a sublayer in a VertiGIS Studio Web Map, and is intended to zoom the map to that feature, highlight it with a graphic, and show the resulting attributes in the Web Studio Map Sidebar.
Everything works until I try to get the search result to zoom to the searched or selected features. The searchForm autoComplete activity works correctly in the sense that I am getting the correct list of field attributes displaying in the search bar. However, when I click the result or click search, it doesn't seem to pass the search results into the queryAddress activity, and so actions beyond the autocomplete for the address don't work.
I've included an image of the workflow below:
The Find by Address searchForm includes the following Outputs:
$searchForm.state, $searchForm.result.
I have the If search activity with the following condition:
=$searchForm.result == “search”
True initiates the queryAddress with the following configurations:
Layer: =$layer.result (from the layer Create Value activity)
Where: =`${$objectIdField.result} = ${$searchForm.state.address.value}`
Return Geometry: true
Output Spatial Reference: =$mapExtent.center.spatialReference
Output Fields: *
Set Map Extent includes the following configuration:
Geometry: =$queryAddress.results.features[0].geometry
Any advice would be appreciated.
-
Without seeing the actual workflow we can only guess what's going wrong.
- Is queryAddress activity actually called, or does the If before it happen to be False?
- Do you have Return Geometry set to True in queryAddress?
- Could you add &debug=true to the URL of your viewer, then open F12 > Console, and then run your workflow? This will let you inspect which activities are being called, including their inputs and outputs
- See F12 > Network to inspect the request that queryAddress executes, does it give any results? (you may want to filter the list by ‘query’)
1 -
Berend's advice is great. It doesn't sound like you've peeked at the console yet, this is invaluable to debugging your WFs. Only thing I'd add is that if your query isn't giving you results, I would check out its query REST endpoint and figure out how to make the query you need because this is generally faster than re-running your WFs.
0
Please sign in to leave a comment.
Comments
2 comments