Geocortex Workflow 5 gives you the control to re-imagine the user experience in any way you see fit. With a constantly growing library of pre-built activities that can be chained together in nearly limitless ways, you can pick and choose which elements hide and appear based on how a user interacts with your application.
An example of one of these elements is the search results section, which can be displayed in a variety of formats to make your end-users receive their spatial data in a way that caters to their specific needs.
This week, we explore some of the ways you can show the search results using the item picker in Geocortex Workflow 5.
“Hi, I’m Ken. I’m on the workflow team, and today I’m going to show you how to show search results in an item picker using Geocortex Workflow 5. Let’s get started!”
Okay, so here we got a workflow where there is a form with a search area and then results in a separate section which is not visible by default. We’re going to use the template here for filling the item picker. This is just the standard template that queries a layer with US states and then presents them in whatever form element we’re populating.
In this case, we’re going to move that – I just did a cut – and then we want to paste into the event handler for the click event on the search button.
I’m just going to make a few little changes to the default template.
The query is now going to be based on the text you just typed. I will say where state name – let’s make it case insensitive – so ‘UPPER(STATE_NAME) LIKE ‘UPPER’, and then this is where we’re going to put in the value from the textbox. Then, we’re going to put a percentage after that. So it’s anything that starts with that text.
The element that this is going to populate is going to be ‘itemPicker1’ and we’re going to show the section too. Let’s save that and then run that in the sandbox and take a look.
There we go! So, you can see you just get the names there (fairly straightforward). If we want to make it more interesting we can do a few things; we can include the geometry to show the actual areas on the map, and we can actually use markdown to style this and include more fields in the text.
For the label here, I’m going to change this into a more complex expression. When you’ve got other texts in there you have to pick curly braces around the field names, and for a new line I’m going to do two spaces. Actually, you know what I’m going to do here is I want to put this state name – or the abbreviation, rather – in the square brackets after. So that would be ‘STATE_ABBR,’ and then the population I’ll put on the next line.
In order for this to work, I’m going to have to remember to include this field in the query and then with Return Geometry, set that to true. In order for that to work, the spatial reference has to match the map.
So, I’ll make these changes and save it. Run this again.
Now you can see a few things have happened. We’ve got the state abbreviation in square brackets, we’ve got the number in the next line, the state itself is bold and over on the map you can see as I roll through these that highlights them on the map.
These are just a few ideas of how you can show search results using the item picker in Geocortex Workflow 5. I hope you find that helpful. Thanks for your time!
Not a Geocortex Workflow 5 user and want to give it a try? Discover all it has to offer below!