Geocortex Workflow can be used to streamline complex business process, automate tasks and create exceptional user experiences. With countless tools and activities available for creating custom workflows, Geocortex Workflow helps users to create powerful workflows to reach any GIS goal!
This Geocortex Tech Tip provides five tips and tricks for making the most of the tools and activities available in Geocortex Workflow. With advice on annotating and organizing workflows and guidance on how to build dynamic forms and add custom stylization, these tips can help you to build workflows that are more powerful than ever!
Video Transcription:
Hey everybody, my name is Patrick Fingler. In this Tech Tip video, I’m going to highlight some tips and tricks for developing workflows, specifically around designing dynamic forms. Additionally, I’ll provide some general best practices for organizing your workflows so they’re a little bit easier to maintain as you move forward. Let’s dive in!
Here we are in the Workflow Designer. I’ve loaded up the workflow that I’m going to be using to go over five tips and tricks for designing and organizing your workflows and building dynamic forms.
Tip #1: Annotate Your Workflows
Tip number one is to annotate your workflows. Here you can see that I’ve added a “Notes” activity to my workflow and it includes a description of what the workflow does.
So, in this case I’ve written that “This workflow allows an end-user to search for hydrants on the map using several different methods, then generate a report based on the selected features”.
With the notes activity you can present notes to your users. Maybe you’re providing this workflow to a customer or sharing it with a colleague, adding notes gives them an overview of what the workflow does.
Additionally, you can see these activities that I’ve added to my workflow. I’ve made the “Display Name” property for the activities to be pretty descriptive of what they do so the user can easily understand their purpose.
Here we have a “Search Form” activity and based on the “User Selection” of that form, they can “search” for some assets, and then we’re going to “Query” those assets. If “0” features are returned, we’re going to present an “Alert – No Features Found”. Otherwise, we’ll “Zoom” to those features and present the user with a “Select Form” to select individual features. Then we’ll generate a “Report Form” based on those selected features.
You could go further and add a description to all of these. For example, I could say that the “Report Form” activity “Generates a report…” and continue to add a description to each of these. However, I personally find that this tends to make the workflow a lot longer. But again, the more annotation you can provide the better and easier it will be to follow. So, definitely make sure your display names make sense and describe the process, and if you feel like you need to, you can add some descriptions as well.
You’ll also notice here if you look at the activity ID’s that we’re working with, I’ve made them easy to access and understand. And this goes for all my activities in my workflow. So not only just the forms, but the underlying form elements as well.
Here you can see that each of these form elements, for example this “Auto Complete”, has a nicely annotated “Element ID” which makes it easy to find specific elements. So, here I’ve got my “bufferGeometryPicker” and my “bufferUnits” and my “bufferDistance”.
You’ll notice here we’re also using this kind of lowercase and uppercase notation. This is called Camel Case. That’s what we recommend in our Workflow training for defining your ID’s just because it makes them easy to access as you’re building and referencing different activities or values in a form.
Another tip is ensuring that these element IDs for your forms, as well as the underlying activity ID’s, make sense and are easy to find.
Tip #2: Use Containers
Tip number two is to use containers to organize your workflows. Here you can see I’ve got a couple of containers. I’ve got this “Query” container, this “Zoom” container, this “Exit” container, and probably most importantly is the “Set Up” container which is where you can group activities together to make it a little bit easier to organize your workflows.
Within a set up container you’ll often have some activities to collect inputs that you want to define for your workflow. Here I’ve created a couple containers within a “Container”, but typically you’re going to want to have some “Inputs” that you’re going to present or provide to your workflow.
And the nice thing about having these inputs or input variables is that if you are referencing a particular variable, for example maybe this “Search Field” or this “Layer Name”, then you only have to change it in one location and you don’t have to change it in multiple locations. So, if for example, the layer name changes or the attribute field name changes, it’s a single location that’s easy to access to adjust as you want to make changes to the workflow.
Also, it makes it easier to migrate this workflow if you want to, for example, quickly change it to search for parcels instead of searching for hydrants. You only have to edit a couple of activities at the very beginning of the workflow and that will kind of percolate through the entire workflow to make it work.
Other common things that you could add in this container here would be to define “Report URLs” or other workflows that you might be referencing. Using these “Create Value” activities is very important for defining these kind of input variables. And again, you can see I’m using Camel Case notation here to make it easy for a user to follow.
I’ve also added a couple other containers here. It’s not necessary, but here I’m defining some “Constants” using activities like “Get Map Extent” and “Get Portal User”.
I’ve also got some “Variables”. These are global variables that will contain different values at different points in the workflow based on different branching and so on. Again, you can go as deep as you want or you can just have a single set up container that defines some inputs.
Tip #3: Define your Input Variables
Tip three would be to define your input variables because those are really important.
Tip #4: Configure Dynamic Forms
Let’s shift gears and look at tip number four, which goes over how to nicely configure dynamic forms.
Here you can see I have a form which has a “Radio Group” which presents the user with three options – “Search by ID”, “Search by Selection” or “Search by Buffer”. And then within here we’re going to be showing and hiding different form elements based on which radio button the user selects.
Let’s look at this in action before diving into it. Let’s run our workflow. Here you can see I’ve got a radio button and when I check each radio button it’s going to show and hide different sections within the form. The reason why we’re using sections here is because this “Buffer” section contains three different form elements and rather than having to define all three of these form elements that you want to show and hide, you can group them together in a section to make it easier for yourself as the workflow administrator to display all of them at once.
Additionally, one of the nice benefits of using sections is you can stylize them. So, for example here we’ve got a collapsible dropdown menu available. We’ve also got different types of section styles that you can apply as well.
Where this logic gets configured is in the change event for this radio group. Here you can see I’ve got three options. We can see the “value” is “id”, “select” and “buffer” for my radio group and I’ve got a “change” “Event”. This change event will get the value of the form.
So again, one of the nice things about nicely annotating your activities is that here it’s now easy for me to find the form element that I want to reference. Here is my “RadioGroup” which I’ve called “searchOptions” and I can pass the value of that, which is the option that the user selected on my form, and then here we’re going to use the “Show Form Element” activity to display different form sections and also to hide them. We do have a “Hide Form Element” activity as well, but the “Show Form Element” activity has the ability to define if an element is visible or not visible.
Here I’m essentially targeting the entire section for the “idSection”, the entire section for the “selectSection”, and then also the entire section for the “bufferSection”. Basically, I’m saying that if the user selects the ID option, we’re going to “Show ID Section” and we’re going to “Hide Select Section” and “Hide Buffer Section”. Vice versa if they select the select option. We’d instead “Show Select Option” and hide the other ones.
This is a really easy way to create dynamic forms using these sections because then you’re not having to define all of the individual form elements within it. You can just target a specific section by its ID.
Tip #5: Configure Markdown in your Workflows
The final tip is regarding markdown. Here I’ve added some bolding to my forms, here I’m using underscores to make things italic. Here I’ve added a single underscore.
We do have some documentation on how to configure markdown. We also have a sample workflow, so if you want to explore this further, I’d recommend going to “New”, search for “Markdown”, open up the display form and then here you can see that it’ll show you how to embed links and images using markdown. We also have a reference to this in our documentation.
So, hopefully that gives you an overview of some tips and tricks for building dynamic forms and organizing your workflows so they’re a little bit easier to manage and maintain moving forward. Bye for now!
Want to learn more about the capabilities of Geocortex Workflow? Click the button below for more information on what is possible with Geocortex Workflow.