Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This can be used with your ESRI ArcGIS account in order to request a token from your Forms inMotion server that can be used with your forms for routing and mapping functionality.  This functionality only works if your server has already been configured with ESRI client information.  Use  

Info
titleForms InMotion Version Requirement

This functionality requires Forms InMotion version 2.6.11 or greater.


Warning

Use of this integration with ArcGIS may result in charges to your ArcGIS account.  Please make sure you understand what you're doing when you publish forms that utilize this integration.


Creating an application in ArcGIS Online

Info

These instructions and screenshots were taken from the ArcGIS for Developers site on 1/3/2017. Specific instructions may have changed.

Sign in to your account at https://developers.arcgis.com.

Select Applications from the menu.

Image Added

Click the Register New Application button.

Image Added

Fill in the New Application Details with information about your specific implementation. This is only visible inside ArcGIS.

Image Added

Once you have registered the application, the next screen will display a Client ID, Client Secret and a Token you can use for short-term testing.

The short-term token can replace YOUR_ESRI_TOKEN in the code sample below for debugging your code outside of your Forms InMotion application.

Image Added

Using your ArcGIS application in Forms InMotion

Log in to your Forms InMotion application as a sysadmin. Click Administration, then Server Config. Enter your application Client ID and Client Secret that you generated in the previous step.

Calling the Token from your form

This integration utilizes the Forms_inMotion API call from your custom javascript.  You'll need to add a call to the Forms_inMotion function in your javascript and specify a call back for it.  An example of this is shown below:

Code Block
languagejs
titleForms_inMotion API ESRI request
function runEsriQuery() {
	if (typeof Forms_InMotion === 'undefined') { 
    	esriToken = "YOUR_ESRI_TOKEN"; //specify a fallback token for testing outside of your Forms InMotion application
    	console.log('Esri token fallback used');
	} else {
    	Forms_inMotion("esritoken", "esricallback");
	}
}
function esricallback(data) {
	data = JSON.parse(data);
	if (data.OK) {
		document.getElementById('esridata').value = data.responseString;
	}
	else if (data.responseContent && data.responseContent=="UPDATING") {
		//the server had to generate a new token.  try this call again
		runEsriQuery();
	}
}

In the above example, the esritoken request is made and we check the response JSON.  If we get data.OK in the response object, then responseString contains the ESRI token.  If we got data.OK=false, then check the data.responseContent.  If the token has expired on the server, the server tells the client that the token expired and it immediately fetches a new one.  It is OK for the client to make the call again and the server should have received an updated token from ArcGIS. 

Filter by label (Content by label)
showLabelsfalse
max5
spacesFIMKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "FIMKB"
labelskb-how-to-article

...

Page Properties
hiddentrue


Related issues