<< Back

Use an Alteryx Analytic App to run workflow A or workflow B

Let’s imagine you’re creating an app. In this app you have to update the database or to insert new data.

However, each one of those actions is based in a different workflow: I have one workflow to insert data and a second one to update what is already in the database.

How to combine both workflows in one app that will run workflow A or workflow B based on the users selection? Is it possible to use an Alteryx Analytic App? Would it work in the gallery?

A few weeks ago I found myself desperately searching Alteryx community trying to answer those questions. I found the answer in a post by Alteryx Ace Patrick Digan. Patrick’s example showed me that a) it’s possible and b) it does run in the Gallery without issues.

How an Alteryx Analytic App does the job

If you’re wondering how to do the same, Patrick’s workflow is shared in the Public Gallery and you can download and open it in your computer . The workaround to achieve this is to create a chained app that will send app A or app B data to a blank file.

Alteryx Analytic App

As Patrick explains, since you have both apps done, you will create a pre-step in which you should import each one of the workflows as a csv with no delimiter (you should use “\ 0” in the delimiter field). You do it through a normal “input tool”, just remember to force it to read the file as a csv.

Alteryx Analytic App

Then you can add interface tools to allow the user to run app A or app B and. You should finalize the workflow with an output in which you will save the result as a yxwz file.

Alteryx Analytic App

This workflow should then be chained to another that is basically a blank file that will get the yxwz file defined in the first workflow and run it.

To make it work in the Gallery, you must have this “blank canvas” to run the workflow chosen in the first app.

Alteryx Analytic App

Make sure the path is correct

When I was trying to use Patrick’s solution, one thing I’ve struggled with was the right combination of paths. When I created the first workflows they were writing to an output folder instead of writing inside the same folder. So the results of both App A and App B were going to “/ Output”.

If this is you case, the final step (blank file) needs to also be in this folder. It will run from there.

It is also important to check if all paths are relative. For this, when saving locally go to Option >> Advanced Options >> Workflow Dependencies and check if all paths are relative.

When saving to the Gallery, go to Workflow Options >> Manage Workflow Assets and check if all boxes are checked.

Remember also to check the configuration of your app in View >> Interface Designer. For the pre-step, make sure it’s running the correct app (remember to check the path!). 

Alteryx Analytic App

For the other apps, make sure to add a browser to their end, so during the tests you can make sure they’re working.

Rachel Costa

Amsterdam, The Netherlands