Using Geocortex Workflow 5 to automatically display a form for editing layer attributes [Geocortex Tech Tip] - Geocortex

Using Geocortex Workflow 5 to automatically display a form for editing layer attributes [Geocortex Tech Tip]

Jeff ten Have
Jeff ten Have
Software Developer
November 16, 2018

With Geocortex Workflow 5, authoring workflows has never been easier. With a library of 170 pre-built activities that chain together seamlessly, you can covert even the most sophisticated business processes into a simple, guided end-user experience.

One of the things that we’re really proud of when it comes to Workflow 5 is its ability to automate virtually any task, so we thought it would be fitting to show you in this week’s Geocortex Tech Tip how to use our Workflow technology to automatically display a form for editing layer attributes.

Watch on YouTube.

Video Transcript

“Hi, my name’s Jeff. I’m a software developer on Geocortex Workflow 5, and today I’m going to show you how to display a form using Workflow so that you can edit features in your layer.

Let’s get started!

So, I’m going to demo this for you today in the new Geocortex Mobile Viewer which means the Esri objects that we’re interacting with in this workflow are going to be from the ArcGIS .NET Runtime, so you might notice a few slight differences form the JavaScript API. So, to show our form we are going to use a display form activity, and I’ve gone ahead and preconfigured some activities for this workflow just to save time.

On our display form activity, we’re not going to configure any form elements and that is because we want to dynamically display the form depending on the layer that we have. To set the dynamic form elements we’re going to use the ‘load’ event handler in the forms header. If we look in here the first thing, we need to do is get the layer using the ‘Get Layer’ activity and I’m going to be using a web map that has a layer with the ID ‘Service_Request_8759’. That’s going to get our layer and the next thing we’re going to want to do is add a form element for each field in the layer. So, we’re going to iterate over the fields in the layer. You can see we’re going layer.featureTable.fields and this feature table is a .NETism.

The first thing we’re going to do on our ‘For Each’ loop is just assign the field to a variable, so that we don’t have to access each For Each loop current item every time so this is a Create Value activity. Then the next thing we want to do is check if the field is editable, so we’re going to check the ‘isEditable’ property. If it’s not editable then we’re not going do anything because we don’t want to display anything.

So, then we’re going to create an object for our form element and we’re going to assign a few properties we’re going to set the description to the field alias and I’m going to set the items to an empty object, which I’ll come back to in a few minutes. Next, we want to decide which kind of view UI control to create for each field.

The first case we’re going to handle is fields that have coded value domains so in this if activity we’re checking if the field has a domain object and if that domain object has coded values. If it does then we’re going to want to show a dropdown box with the coded value domains in it. So were going to iterate over the coded value domains so you can see ‘domain.codedValues’ in our For Each loop here. And the first thing we’re going to do in here is just assign the coded value to the variable, so we don’t have to access the For Each loop every time and we’re going to create an object for the form item.

The ‘label’ is going to be the name of the coded value and the ‘value’ is going to be the value of the coded value. And then we’re going to set this item on our form element object. As you can see, I’m targeting the items property of the form element object. And we have to assign it a unique ID so we’re just going to use the pass of the For Each activity and we’re going to call toString on it because it has to be a string ID, and we’re going to pass in the object we just created. Next, we’re going to add the dropdown list form item to our form and we’re going to do this using the ‘Add Form Element’ activity. We have to provide a unique ID, so we’re going to use the name of the field and we have to specify the type of form element that we want to use (you should get some intellisense in here), we want to use a dropdown list and we’re going to put in our form element object that we just created.

Next, I’m going to show you how to do a number field. So, for this we have to look at the fieldType property of the field and in .NET, this is a numeration that is backed by integers, so we just have to compare it to its integer value, so the value for an integer is one. So, we want to create a format object for our number to ensure it appears as an integer – so to do this we set the precision to ‘0’, meaning no decimal places are shown and we want to set the step to ‘1’.

Next, we want to set our format object that we just created on the form element object, so we’re setting the format property on our form element object to the format object that we just created. Once again, we’re going to use the Add Form Element activity to add this to our form. This time we’re going to chose number and we’re going to use the field name as the ID. So next I’m going to show you a string field. So, the integer value of field type for a string is ‘7’, so we’re just checking for a ‘7’ so in that case we want to add a TextArea form element to our form. So, it’s the simplest case using the field name again.

Alright, I’m going to demo this for you in the Geocortex Mobile Viewer now.

Let’s quickly take a look at the Json in the feature layer that I’m using here. These are the fields in the feature layer, and you can see I have a string field called ‘REQUESTSTATUS’ that uses some coded value domains; there’s three domains in there. I’ve got a regular string field called ‘DESCRIPTION’ and an integer field named ‘SEVERITY’. So, this the workflow that we made to show the form elements will cover all three of these fields.

Let’s pop open Geocortex Mobile Viewer and I’ll show you the workflow. So, this is just an extremely bare bones version of the mobile viewer that I’ve configured solely for the purpose of showing you this workflow. So, I have the workflow on the task bar and if I click on it, you’ll see that I’ll get one form element for each of the fields that are editable. So, I’ve got my ‘Status’ element which is a dropdown box. I can choose the value, the ‘Description’ field is just a string field, and the ‘Severity’ field is just an integer. So, if I type in that I can see that it is an integer and I can step up my integer values.

And that’s how we create a dynamic form for a given layer. Thanks for watching!”

Interested in trying Geocortex Workflow 5 for yourself? Check out our Discovery Center and explore everything Geocortex Workflow 5 has to offer!

Discover Geocortex Workflow


Categories:
Archive
Open: 2018
2018
December 21, 2018

Integrating Pictometry, Bing and other 3rd party maps within your Geocortex applications

December 19, 2018

Recapping the Texas Geocortex Regional User Group

December 14, 2018

How to use Geocortex Workflow 5 to populate the Attribute Table in Web AppBuilder for ArcGIS [Geocortex Tech Tip]

December 12, 2018

Finding yourself: Using geolocation in mobile and web applications [Webinar]

December 7, 2018

Enabling real-time user-to-user map collaboration within Geocortex Essentials

December 5, 2018

Reflecting on 2018

November 30, 2018

Creating mailing labels with reports with Geocortex Reporting 5 [Geocortex Tech Tip]

November 29, 2018

Alberta Energy Regulator: Supporting safe and responsible energy resource operations

November 26, 2018

Important update for ArcGIS and Transport Layer Security (TLS) Protocol Support!

November 23, 2018

Using fine-grained security to control access to layers, features, attributes and application functionality [Geocortex Tech Tip]

November 21, 2018

Enhancing Web AppBuilder for ArcGIS® with Geocortex Reporting [Webinar]

November 16, 2018

Using Geocortex Workflow 5 to automatically display a form for editing layer attributes [Geocortex Tech Tip]

November 15, 2018

Geocortex Achieves Esri’s “Release Ready Specialty” Designation

November 14, 2018

Celebrating GIS Day with York Regional Police: How GIS Data Has Mitigated Risk & Increased Efficiency in Crime Prevention

November 9, 2018

How to access a SQL database from a workflow using Geocortex Workflow 5 [Geocortex Tech Tip]

November 2, 2018

How to send an email from a workflow using Geocortex Workflow 5 [Geocortex Tech Tip]

October 26, 2018

How to add and configure charts inside reports with Geocortex Reporting 5 [Geocortex Tech Tip]

October 24, 2018

Geocortex Water Webinar Series

October 19, 2018

Integrating Geocortex Essentials with ArcGIS Online and ArcGIS Enterprise portal [Geocortex Tech Tip]

October 17, 2018

Cross-Platform Development with Xamarin [Webinar]

October 12, 2018

City of Fort Collins: Dynamic flood maps for public awareness, and flood insurance rate saving

October 2, 2018

Technology Q&A: Geocortex Workflow 5 “Behind the Firewall”

June 27, 2018

Geocortex Essentials 4.10 is here!

June 12, 2018

Geocortex and the GDPR

June 6, 2018

Geocortex at the 2018 Esri User Conference

May 15, 2018

Technology Q&A: The evolution of Geocortex and Web AppBuilder for ArcGIS

April 25, 2018

How to manage data collected from Geocortex Workflow 5 forms [Geocortex Tech Tip]

April 18, 2018

Delivering accessible mapping applications for everyone [Geocortex Tech Tip]

April 11, 2018

How to search for data in a non-spatial database [Geocortex Tech Tip]

April 5, 2018

Configuring Geocortex Analytics to monitor a new Portal for ArcGIS instance [Geocortex Tech Tip]

March 27, 2018

Getting started with forms in Geocortex Workflow 5 [Geocortex Tech Tip]

March 21, 2018

Using Geocortex Workflow with Web AppBuilder for ArcGIS [Geocortex Tech Tip]

March 15, 2018

Understanding tool usage in your GIS applications [Geocortex Tech Tip]

March 7, 2018

Running Geocortex Essentials workflows from an identify operation [Geocortex Tech Tip]

March 2, 2018

GIS Health Assessment: A new way to think about your system

February 28, 2018

Using the in-app help system in Geocortex Workflow 5 [Geocortex Tech Tip]

February 21, 2018

How to configure a personalized dashboard in Geocortex Analytics [Geocortex Tech Tip]

January 25, 2018

GIS is shifting to SaaS, and it’s a win for everyone


Categories

Popular Tags
Accessibility Active Operating Picture ArcGIS ArcGIS Online Customer Story Data Models Energy Esri Geocortex Geocortex 5-Series Geocortex Analytics Geocortex Essentials Geocortex Mobile Viewer Geocortex Printing 5 Geocortex Reporting Geocortex Reporting 5 Geocortex Web Viewer Geocortex Workflow Geocortex Workflow 5 GIS GIS Day GIS Health Integrations Oil & Gas Pipelines Portal for ArcGIS SaaS Tech Tip Tech Tips Transportation Water Industry Web AppBuilder Web GIS Xamarin

Contributors