We're excited to announce that we'll be partnering with Credly starting October 19th - see what this means and read the announcement blog here!

Engine Works

Under the hood of Alteryx: tips, tricks and how-tos.
16 - Nebula

I thought I would open this blog by pointing out that this was all my work, and wasn’t at all massively influenced by @TheOC, however, even if it were all his idea, I hired him and therefore I’m a genius by proxy.


Them’s the rules.



I was working with a client who I’m going to call Jeff. I will be producing a full use case on this at a later date, so I won’t be going into the details of that here.


A situation arose where the chained app functionality only got us so far and we needed the ability to individually tailor the second chained app according to the parameters of the first.


“McEleavey, you Brobdingnagian cognoscente,” spoke Jeff, “how on Earth do we pass through Value X and have this influence the wording in the Interface Designer in the second app?”


This was a confusing one. I’ll expand on the required sorcery.


The Challenge

Let’s say you have the following data set:




This is a representative sample of 28,000 employees, who collectively report to around 2,000 managers. These managers need access to manually over-write the Monthly Figure on an ad-hoc basis.


I needed to write an application to be deployed via the Gallery, that allows the manager to select an employee, among other things, and then have the information returned, so it will show the employee, their monthly figure etc.


Then, the manager will be able to input a new figure, but the default value in the entry box needs to be the current monthly figure. So, this needs to be dynamic according to the employee that has been discussed.


This would mean the manager would then be presented with the following:







The tailoring of the wording in the second app to show the name and monthly figure of the selected employee is not possible, right?


Jeff thought he’d stumped me.




It was Friday and my brain was basically doing the Badgers song, so I decided to go and have a little drink.


Passing through parameters for interface tools is simply achieved by outputting the appropriate file from the parent application to be consumed by each tool, for example drop-down lists. However, the wording for each one and the default values in each box need to be dynamic.


How would I do such a thing?


The answer was relatively simple and required only that I hire someone smarter than myself.


I had built the apps and had them all chained together, the parameter files were all outputting and being loaded in as expected and almost all was good with the world aside from the pesky bits I couldn’t make dynamic.


Then, I had an idea. I had messed around with the XML in the workflow files before, so I thought, what if I load in the XML from the app to which I’m chaining, amend it in a macro and drop out the file. Unfortunately, I was never able to get the file to save without corrupting and so the idea was dropped.



However, at this point I thought I would bring in another brain and given the time of day and nerdiness of the challenge I was reduced to bringing in @TheOC, who I found sniffing around the bins.


I told him to put down his vase of Lambrusco and explained the problem. Against all odds he arrived at an incredibly simple yet stunningly effective solution.


We were going to dynamically hard code the chained app.


Yes, that’s right. Dynamic Hard Coding.


The Sorcery

We had our first app which simply asked the user to input the Employee ID they wished to amend, and that would then trigger a chained app.


So, we started with this:



We then built the chaining into the Interface Designer as follows:




Ok, so far, it’s just the standard app chaining you’ve come to know and love, but there’s more.


I needed to dynamically determine what Dynamic Hard Coding Part 2.yxwz actually looked like, and I needed to make sure every user got their own version every time.


This meant building a version of Part 2 as a template, which we would load, amend, and save as Part 2, to which we would then chain. Are you still following?




To do this, we would open the Part 2 Template file, which looks like this:




As you can see, the text for the Numeric Up Down tool contains hard-coded values, with parts of the text changed to represent what will be over-written.


First, we used an Input tool to load in the Part 2 Template, using a Flat ASCII file type:




Ensure you check “Allow long lines” and increase the record length to 6500 (the maximum allowed) to be sure all characters are included:




We were now presented with all characters in the XML of the entire workflow.


Secondly, we apply the amendments to the parts of the text to be dynamically overwritten, and then we save out the template as the Part 2 file to which we will chain.


Following this revelation which @TheOC came up with during the early hours of Saturday morning while I was out partying and kissing girls on the mouth, everything became incredibly easy and we both suddenly realised what we had discovered. We can literally change anything in the second app according to logic determined in the first.


We can change detours, switch containers on and off, change wording dynamically, change all, logic…


The basic flow is as follows:


Application 1 runs as a normal app, but also loads in Application 2 Template as a Flat ASCII file. The required changes are made to this file and it is then saved as Application 2 (therefore always retaining the template version).




Here you can see the changes are being applied to the “Dynamic Hard-coding Part 2 Template” app. These changes are then being saved out to “Dynamic Hard Coding Part 2.”


Application 1 completes and chains to Application 2.


The flow looks like this:






Importantly, when chaining, either use the %Engine.TempFilePath% as the folder location for the template and the output, or simply leave this blank and only use the file name. This will allow the user temp folder to be used, and therefore if you have many users hitting the files simultaneously, they will always be operating their own version.


And there you have it. Jeff had not stumped me. Keep trying, Jeff.


Dynamic Hard Coding.




Image credit to Jarkko Mänty


16 - Nebula

Some very minor, almost insignificant thanks go to @TheOC for this.

Hardly worth mentioning, really.


Also, the enigmatic Jeff.


Also also, @danilang for pointing out this was very cool and wondered why I only got one like for the idea in a solution.

Dan, it's not a popularity contest. I didn't cry myself to sleep that night, hardly at all.



12 - Quasar

oh that 'TheOC' sounds like a massive loser...

Really cool post Chris! Big fan of the term 'Dynamic hard coding' 😁. Hopefully this will help some server users unlock some potential of analytic apps!

6 - Meteoroid

To the contrary @TheOC, you sound like the brilliant and eccentric one... and that Jeff guy sounds amazing with his clever questions.


Really great work on this Chris! 

16 - Nebula

Hi @mceleavey,


Great article. It was super fun to read it.


Hi @TheOC,


Well done 🙂 

16 - Nebula

Thanks Emil, and "Jeff" 😉



10 - Fireball

Holy Moly, that's some 4GL stuff there !

16 - Nebula

And it wall all me, @DanHare.

Me, and nobody else.

12 - Quasar

@mceleavey stop flirting with me

5 - Atom

Did this work on the gallery? Last time I tried this (admittadly several years ago), it didn't work on the gallery.

16 - Nebula
16 - Nebula

@mceleavey@TheOC  this is awesome!


I'm definitely going to play around with this!

16 - Nebula

@camerondsteele , yes we're running this as a multi-chained app through the gallery. The full use-case is more complex, but the bit we found was tripping us up initially was file-pathing.

I think we'll do a video of the use case in future going through the full details, but yes, we have multiples of these working through a gallery servicing 28,000 people.



16 - Nebula

Thanks @DavidP !

16 - Nebula

@atcodedog05  and @Qiu , I thought this would interest you.



18 - Pollux
18 - Pollux

So, who is more the genius?  The Genius or the one who recognized the genius of the Genius's idea?


Good job here!



17 - Castor

This looks awesome and already in my bookmark.

Thank you much and can always learn so much from you.

btw, begin to doubt about the relation between you and @TheOC 😁

16 - Nebula

@danilang ,


I'm a genius by proxy.


My question to @TheOC is...



the who follows him.gif

20 - Arcturus

Hi @mceleavey 


Yes, thats right if we cant make it happen through workflow or files let break into the XML and get hard core 😎


This is one of the lesson which i have been constantly seeing/learning especially from @danilang techniques, lot other posts and people.

I was discussing on a post with @TheOC i guess. That Is everything really XML ? and can anything really be edited through XML ? 😅


Overall great story and a great usecase 🙂. A new direction to think in, to dynamically customize the app. This is just the beginning with this we can totally change the apps interface questions by writing them from a choices of XML code to the app template.


This was a great treat. Thank you @mceleavey & @TheOC 🙂

16 - Nebula

Thanks @atcodedog05 ,


Yeah, it opens up an array of possibilities. Perhaps even an XML building wizard that allows for dynamic app creation etc.


I'll leave that to the smarter people.



20 - Arcturus

Hi @mceleavey 


I thought you were genius by proxy 😏


Anyways looking forward to much more possibilities from this concept. I am sure you will be coming up with much more usecases too  🙂

16 - Nebula

Yeah, @atcodedog05 .

We've actually built a few of these which I'll be writing up as full use cases in the future along with @Jeff_Neklason  .

20 - Arcturus

@mceleavey  Cool!! looking forward to it 🙂

17 - Castor
17 - Castor

What a nice hack @mceleavey 


This post is super helpful. That's why I think nothing is impossible with Alteryx, you just gotta think harder to be able to make it.

9 - Comet

 @mceleavey Its way too an advance topic for me but will get there you add a great value to the Alteryx Community.



16 - Nebula

Thanks @suby, you're right, you'll get there!


Thanks @Thableaus. I agree, if I can't do it in Alteryx I assume that's my lack of ability, not the platform.


Thanks @atcodedog05

16 - Nebula

Everyone has glanced over the best part of this post - the description of Durham night life. Who knew! Sounds much livelier than Gateshead.

6 - Meteoroid

@apathetichell You are assuming that @mceleavey ever leaves his house... I believe that part was just a dream