Looking at talking to a Geographic Information System from an automated business process? Well, Nintex Workflow will let you talk to most any system that has a web API. A great example of that, is Esri ArcGIS.
As long as you have applied for a developer account, you’ll be provided with a Client ID and a Client Secret. That is all you’ll need, in order to talk to ArcGIS.
To make things a little easier, I’ve put together a Nintex Workflow User Defined Action to generate an ArcGIS Access Token. The second User Defined Action is a way to show you how to use the Access Token to get data from ArcGIS.
The data that is received from ArcGIS is in JSON format. Since there’s no simple way to get data out of that with Nintex Workflow, you can use the Regular Expression to extract the data you need.
Generate ArcGIS Access Token
Firstly, Esri gives you a Client ID and a Client Secret. These are required to query ArcGIS and to get back an Access Token. This Access Token has an expiration, so if you are going to store that for later use, make sure you keep track of when it expires.
To make things easier, I’ve created two Nintex Workflow constants.
ArcGISClientID – stores the client ID
ArcGISClientSecret – stores the client secret
In the Generate ArcGIS Access Token UDA, I put together the URL that will look like this : https://www.arcgis.com/sharing/rest/oauth2/token?f=json&client_id=ArcGISClientID&client_secret=ArcGISClientSecret&grant_type=client_credentials&expiration=1440
The data that comes back will be in JSON format, and I extract the data I need (Access Token) with a couple of Regular Expression actions.
The result of this UDA, is that you will have an Access Token. I don’t return the expiration date in this example, but if you want to reuse the token, you should get that and store it (do some calculations).
Getting Enrichment Data for a Location
The second User Defined Action is to show you how to use the Access Token and get more information from ArcGIS.
One interesting way to use this, would be to have a Nintex Form that someone fills in, and part of it is to capture the Latitude and Longitude. Once you have these, you can query ArcGIS for that location information.
This User Defined Action will take the Latitude, Longitude and the Access Token and query ArcGIS for information. In this case, we are specifically getting the male and female population. Again, the data coming back from the ArcGIS web request call is in JSON format. We are using Regular Expressions again to pull the data we need, out of it.
I’ve created a Site Workflow to show how to use these UDAs.
Notice that I am getting a token first, then querying ArcGIS, using that token.
The first UDA is very simply to use. It has one Output parameter to store the Access Token.
This UDA takes a little more in regards to parameters. Three parameters for the Access Token and Latitude and Longitude. It also has two output parameters, which are the Male and Female populations.
This UDAs are not the end and are not a complete solution. It’s a starting point for you to think about how to get the data or put data into Esri ArcGIS. Hopefully, it’ll be a good place for you start, if you want to do this from a business process.