Vadim Tabakman

Nintex Workflow - Talking to Esri ArcGIS UDAs

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.

Warning

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.

UDA Usage

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.

Conclusion

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.

Downloads

Nintex Workflow 2013

Download the Generate ArcGIS Access Token User Defined Action - Download it and import into the New User Defined Action page (DO NOT try to import these into the Manage User Defined Actions page)

Download the Get ArcGIS Enrichment Data User Defined Action - Download it and import into the New User Defined Action page

Download the Site Workflow - Download it and import into the New Workflow page

Posted by Vadim Tabakman Wednesday, December 30, 2015 2:01:00 PM Categories: ArcGIS Collection Operation Collection Variable Esri External Regular Expression User Defined Actions Web Request
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Wednesday, February 17, 2016 10:46:24 AM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hi Vadim,

Great work here -- I'm wondering if you have similar information on how to POST list data to ArcGIS, rather than get? I understand you need info such as a feature class, etc., and a JSON script to do this.

Wednesday, February 17, 2016 2:22:05 PM

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hi Amanda,

I'm afraid I haven't, and I think my trial account has probably expired to play around with it.

But with the Web Request action, you should have no issues sending a JSON packet to ArcGIS.  I'd recommend putting the JSON together in a Build String action. 

Have you already tried this and hit some issues?

Vadim

Thursday, February 18, 2016 5:20:36 PM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hi Vadim,

Thanks for the reply -- I've had no trouble putting together a JSON script as it turns out using build string.

The thing I am really struggling with is authentication. The web request keeps returning an unauthorized access error when I attempt to post. Requesting a token is no problem, but I think the issue may be that our feature service is located on a server, not in the cloud.

Anyways, I'm wondering if you could put together a screen shot that shows how you set the token for the get/post web request? I just want to make sure I'm entering it correctly.

If you have time it would be much appreciated.

Thanks,

Thursday, February 18, 2016 10:52:20 PM

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hey Amanda,

do you want to see how I use the token in the Web Request, or how I obtained it?

Vadim

Friday, February 19, 2016 9:24:07 AM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Both, please :) -- is it specifically for ArcGIS in the cloud or can this method also be used for https:// encrypted on prem servers?

Friday, February 19, 2016 4:41:59 PM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

The download link for the UDA that includes a query to ArcGIS doesn't seem to work --> points to a generic Store_Data.uda. If I could even get access to this, it would go a long way.

Wednesday, February 24, 2016 4:57:02 PM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hey there Vadim - I managed to successfully generate a token. Now I just need to figure out how to POST add features to the server. If I figure it out I'll write a post -- seems like other people may want to know this. Any input you may have is appreciated. Think you could re-post the UDA for the query you make using the token so I can see the URL string?

Thursday, February 25, 2016 11:14:05 AM

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Awesome.  Thanks for letting me know.  I'll see what I can find.

I've been at the Nintex InspireX event and really swamped.

If I can check this out over the next few days, I'll let you know.

Vadim

Wednesday, March 2, 2016 5:45:07 PM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hey Vadim,

 

Good news! -- I figured it out with the help of an ESRI developer. Works like a charm. I'll write up a community post about the method later. Thanks for the help!

Wednesday, March 2, 2016 5:46:26 PM
Amanda
Gravatar

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Hi Vadim,

 

Good news! -- I figured it out with the help of an ESRI developer. POST list data to ARC on premises works like a charm. I'll write up a community post to share the intel next week. Thanks for the replies and interest.

Amanda

Friday, March 4, 2016 9:19:18 PM

re: Nintex Workflow - Talking to Esri ArcGIS UDAs

Oh that's awesome Amanda.  I'm so glad you got it working.

Thanks for letting me know.

Vadim

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register





 

Statistics

  • Entries (249)
  • Comments (1729)

Categories