We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to pass parameters from an external file to a workflow.

franc1s
8 - Asteroid

 

Hello. 

 

I have a number of workflows that require parameters to be passed to them. I do not want to pass them through user input, but, through a text file (like a configuration .ini file). The content would be similar to what you can see below.

 

The parameters in the file are to be recombined to locate the files in a directory structure (eg. c:\20220100\CERT 02 GAM.xlsx) and also serve as input parameters when selecting data (eg reporting_period=20200100).

[general]
reporting_year = 2022
reporting_month = 01
reporting_version = 00

 

[files]
certification = CERT 02 GAM.xlsx
gcap_taxearn = gcap_taxearn_01.xls
gcap_90202 = gcap_90202_01a.xls
gcap_taxbalsht = gcap_taxbalsht_01.xls

I am reading the file as a "=" delimited text file, and I end up with these key value pairs.

franc1s_1-1646139539963.png

 

Now, how can I connect these key combinations to update input tools, filter tools etc?

 

Maybe this approach feels somewhat awkward, but, this exercise is part of a migration from python to alteryx, where I want to be able to continue to use the python tool chain (which makes use of the configuration files) whilst certain aspects are converted to alteryx. Also, I would like to control the workflow outside of alteryx, not from within.

 

Many thanks in advance for any insights you can share.

Francis

 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @franc1s 

 

Usage of an external config file (can be a normal excel) is a common method which is used across to build flexible workflow so they can make workflows adapt with no code changes.

 

Now the question to you is what do you want to do with this config how do you want to control your workflow? based on that logic can be built.

 

Hope this helps : )

franc1s
8 - Asteroid

Hi @atcodedog05 , The input type has to be a text file. I believe that in excel, I would be able to come up with something with less steps.

 

First step is to format the table such that it would look something like this.

 

franc1s_0-1646141609283.png

So, I need to convert my initial structure to a row based one I believe. I havent been able to do this with the crosstab tool.

 

I can then join this with another dataset to filter for a specific reporting_period.

 

I also cant see how I can use this structure to provide the input filenames to the Input tool.

 

Thanks!

franc1s
8 - Asteroid

I just got the crosstab tool to do what I wanted!! So, my remaining question is, how to connect to the input data tool. Thanks for helping me focus @atcodedog05 !

Labels
Top Solution Authors