Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Engine Works

Under the hood of Alteryx: tips, tricks and how-tos.
ned_blog
8 - Asteroid

To start at the end, the source code associated with this article can be found at the end of this post. The projects are all built with VS 2005.

 

I have received a bunch of questions about using the Alteryx API lately. It is mostly straightforward, but it is can be confusing how to find the latest installed Alteryx directly and properly wrap calls from C#/,Net to the Alteryx API. In order to simplify using the API, I wrote a simple wrapper that not only wraps the Alteryx API, it also will find the latest installed version and link to it without having to do anything special. The interface is compiled for any CPU, and will detect if you are running in 64bit or 32bit and find the appropriate Alteryx. It you are running in 64bit and you only have a 32bit Alteryx installed, it will fail. All failures are thrown as a AlteryxApiException. In order to use that Alteryx API, all you need to do is to include AlteryxAPI.Net.dll as a reference in your project. That's it, just start calling the API and it will deal with finding the currently installed version.

 

In addition, there is a new API sample application. It just implements a Mortgage Calculator wizard. It shows running a custom interface on top of a wizard. It allows a user to solve for any of the common Mortgage parameters. It does it all via an Alteryx Wizard. It also shows the version # of the Alteryx that it found installed.

The Interface of the sample app

 

 

The Alteryx wizard behind the scenes

 

This application does show one advanced API feature. There is a special tool that can be used to send output directly to the API without going through a file. This application uses that feature to directly populate the result into the form. This example shows just how easy it is to link to the Alteryx API to perform a complex operation. There are only a few lines of code that deal with the Alteryx API at all.

 

In addition to creating the new DLL wrapper, there is an associated help file:

 

Update: There was a small bug in the Alteryx wrapper from this article that could generate an Null Reference exception if you didn't have the correct Alteryx installed. (32 vs 64 bit). The code (found here)

Comments