This article is part of the Alteryx Obscura Blog series. Alteryx Obscura is the Inspire session dedicated to all things non-analytics, highlighting what the software “can” do rather than what it’s “supposed” to do.
Let’s crank the silliness up to 11 and get into… the napkinalteryxifier!!
You’ve had a problem stuck in your head for days, when that lightbulb moment suddenly hits you! You've just figured it out! You have to capture it, but you're at your kid's party at the bowling alley, your phone is dead and all you can find is a bunch of napkins and a dodgy pencil.
You consider your options. You start drawing it, but it doesn't quite work. The kids are having a blast, you're going to be here for hours...
You’re now 4 coffees strong, and crazy thoughts are starting to go through your head. What if you could invent a type of pseudo code to capture your workflow logic, and then somehow feed it into Alteryx, but how?
15 napkins in and you think you're onto something...
Then suddenly you feel a knot in your stomach, and a sickening feeling washes over you. You try to resist, but it’s pointless, as you realize that in order for your pseudo code to work, you’re going to have to join…
Team vertical!!
Ok, so here’s the brief premise:
You’re trying to fully describe a workflow, handwritten on a piece of paper/napkin, then take a pic with your phone and email it to yourself. You then want to load that image into Alteryx and convert the handwritten text to computer text that you can then put through an interpreter (that you built in Alteryx) to construct and save an Alteryx workflow XML file, and finally run it. Pretty simple when you put it like that.
The workflow description consists of Tools (called nodes) and Connections (called connections) with the following attributes:
The first part of the “workflow construction” workflow needs to load the image as a blob, base64 encode it, and prepare the payload for the Google Vision API to convert handwriting to computer text (I hereby exercise my Rule #1 rights…), which is returned via the download tool as JSON.
This does work, but with some caveats. I’ve had to set up a Google project (called “alteryx-text-ocr”) in my Google Workspace and then generate a refresh token for the authorization. I’m sure there are ways to productionize this, but not for a one-time 4.5-minute presentation!
The API returns A LOT of information in JSON format, from which you need to extract the actual text and discard the rest.
In the attached workflow, I’ve created a stub with the result of the steps above that can be used to demonstrate the rest of the workflow.
The next part of the workflow tidies up the pseudo code by combining every node into a single row per node and splitting nodes and connections.
In the final part of the “workflow construction” workflow, we can now identify the required tools and load their XML template code from a tools library. We can then substitute the workflow configurations from the pseudo code into the XML templates, prepare the Connections XML code from the pseudo code, and finally put together the output workflow XML structure and write the generated workflow XML to a file called test workflow.yxmd.
Clicking on the test workflow.yxmd file in the Results window opens up the generated workflow in Alteryx.
It appears that 3 tools have errors in the resulting workflow. This is because they are missing metadata. Once you run the workflow, these errors disappear, as the metadata gets generated.
The workflow does run and produces the desired result!
While the story above is entirely fictional, created for Obscura, the resultant workflow is not. Back in 2020, I had a Community problem stuck in my head for a few days, and I had a lightbulb moment. It was called the First In First Out (FIFO) problem applied to incoming and outgoing batches in a warehouse. I specifically wanted to solve it without an iterative macro. The lightbulb moment came when I realized that if I converted each batch to multiple rows with a quantity of 1, FIFO becomes a trivial take from the top exercise. The workflow above is the actual FIFO workflow that I posted as the solution.
The link to the original Community post is here.
I have subsequently used this FIFO technique a number of times in production workflows and helped a client to implement it as part of a Duty Drawback solution to claim back import tariffs, which was presented at Inspire 2024 and aptly called “The $7.5M workflow”. If you want to know more about that, also feel free to get in touch.
1. Be curious - look under the hood of your workflows.
While this was an exercise in extreme silliness, the idea of looking at your workflow XML is not. I frequently have my workflow open in Notepad++ as well as on the canvas while developing. Understanding the basic XML structure is much easier than you think, and it is very easy to see hardcoded folder local paths for both input files and macros that will cause issues if you were to share your workflow with others or publish it to Server, for instance.
2. Think of ways to push the boundaries.
Yes, we obscurists push Alteryx to do things that it was not designed for, just for fun, but in the process, we keep learning. You can all do the same. Invent your own pet project and have fun with it. The hours spent on it will teach you things you might never have learnt otherwise.
3. Try something completely silly and see where it leads you.
Rule #2: Solutions do not have to be useful. Let your creativity run wild and see what you come up with. I bet you’ll surprise yourself and, in the process, keep rediscovering the thrill of solving.
4. Break a complex problem into simpler parts and solve them individually.
Complex problems often seem, well, complex/difficult/unsolvable, until you break them down into their simplest constituent parts, which are much easier to solve. Once you’ve solved these and put them back together, you’ve cracked the big, complex problem.
I hope you enjoyed this, and please get in touch if you have any questions. Also, look out for my next Obscura blog on how to build and solve a jigsaw puzzle in Alteryx…
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.