Building a Drop Down Select Tool in Alteryx: Analytical Applications for Dynamic Data Input
Often when building an analytical application in Alteryx, I have to consider that my users will be uploading information that includes different header (i.e. field names). Some of the information in their data may be applicable to my tools, and some information may not be.
Therefore, I needed a way for the users to specify to the workflow which fields represented necessary information, and for the application to dynamically consider other “unnecessary” data fields.
When I start building such an analytical application, I make sure that my input and workflow are structured as follows:
- My headers are in the first row of data
- In my input, I specify that workflow should read in a specific column range – Usually A-Z
- If you are using a File Browse interface tool, you should use the configuration imaged below in your Action tool connected to your input tool. This confirms that when the user uploads their data, they are uploading all of their columns, even columns that have zero records in them which may be ignored for that reason by the input data tool. This is important.
- I use a Select Records tool to isolate that first row of information (my field headers)
- I use another Select Records tool to remove that first row of information (my header fields)
- I transpose the data coming out of the Select Records Tool that has my field headers in it, and rename the fields to “Original Header Names” and “Given Header Names”
- In order to select a field that is required in my workflow, I first decide what to name that field. In this example, I named the field “sales_information”
- I use a drop down tool and “Manually Configure” the list of options. I configure the list of options as such: Column A: F1, Column B: F2, Column C:F3, etc.
- In that drop down tool, the user can select which field (i.e. column) represents “sales_information”. Make sure to configure the Action tool connected to your Select tool as is done in the image below.
At the end of the manipulation and work, I use a Dynamic Rename tool to replace the given header names (i.e. F1, F2, F3, etc.) their original names found in the data input. These are the fields that are not needed in the actual analysis within the workflow. The Dynamic Rename tool uses the transposed table of header names we created earlier to replace the given header names with the “Original Header Names”.