Steps for displaying query results based on check group(s) checked
I would like to create a simple workflow where a user submits a Check Group form, and for each item that is checked the map displays the results of a corresponding query. Its a list of amenities associated with various services, so for example, if they checked "Shelter," then they will see all features where my Shelter field = "yes". How can I do this?
-
Hi Jessica,
If I understand your question correctly, the pattern you could use would be:
- Use the Create Value activity with =[] to create an empty array that will later hold your checked items
- set up a For Each activity that loops through the items in the check group. Inside, use an If to check whether each is checked. For the ones that are, use Add Item to put their value in the array, along with the text you need to make the query. Eg, in your case where you're checking if fieldname = 'yes', use =$forEach1.item.value + "='yes'"
- Use the .join() method to write out a string from your now-filled array and build a valid query where clause. Eg, =$value1.result.join(" or ") would build a where clause that looks like this: value1='yes' or value2='yes' or value3='yes'. That would go in the Where input for the Query Layer activity
- Add whatever else you need to select/highlight the features from the query result for the user
See attached skeleton example
0 -
Hi Amanda,
Thank you very much, this worked great. I used the results for a Query Layer activity with Show Results, and that's all working well, but I am having trouble getting a Highlight on the query results. I've tried Using Run Command > HighlightFeature, with command parameter =$query1.features, and I've tried Get Symbol from JSON > For Each (Set Feature Symbol) > Add Graphics Layer Features, and neither route is working. What is the better way to go about this?
Thanks,
Jessica
0 -
Also... I looked at the reply in https://communities.geocortex.com/s/question/0D5f200005gA4L1CAK/highlight-query-results but still couldn't figure it out. I'm using Geocortex Viewer for HTML5.
0
Please sign in to leave a comment.
Comments
3 comments