community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Tool Mastery | Drop Down

Community Operations Manager
Community Operations Manager
Created on

This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here Drop Down.pngwe’ll delve into uses of the Drop Down Tool on our way to mastering the Alteryx Designer: 

 

The Drop Down Tool is part of the Interface Tool Category and can be used when creating Apps. This tool has many great configurations from loading data from within the workflow to using outside sources to update tools. Hopefully, after reading this article and looking at the samples you will feel more comfortable using this tool in your app user interface.

 

When building apps, whether to use on your own or to share on a Gallery, the Interface Tools you choose are important for convenience as well as efficiency. One of the more dynamic Interface Tools to use is the Drop Down Tool.

 

Before we begin, please remember that in order to use the Drop Down Tool properly, your Action Tool will also need to be setup to update the tool using the variables chosen in the Drop Down Tool. To learn more about the Action Tool, see here.

 

Configuration: 

 

Configuration.jpg

 

I have attached a workflow that contains a majority of the Drop Down Tool setups, but want to walk through a few specific setups. If you are interested in the other setups you can visit the help for this tool.

 

External Source - Must contain Name && Value Fields (can be relative path) If you want to use an external file with a Name field that will appear to a user that is associated with a value to update a tool this is a great option. For example, many users will take advantage of this option when they have employees names and employee IDs. The file can be updated with new employees or when employees leave. The user won't need to know the employee ID and just the name, while the workflow will use the employee ID as the variable to update a certain tool. This makes it easier for Alteryx to use an ID rather than using a name especially if people have the same name.

 

Important pieces to remember in this List Value:

                                          1. The file used must contain the fields Name and Value

                                          2. If the app is used on the Gallery, the source file will need to be included as an asset

 

Fields from Connected Tool - This is a configuration that many users have trouble with. The benefits of this List Value is that your Drop Down list can be pulled from your data within the workflow. The important piece of this is to remember that the data you want to be in the Drop Down needs to be in the Field Headers. The best way to accomplish this is to use a Cross Tab Tool.

 

I have data that looks like below. I want the names to be in my Drop Down:

 

Text input.jpg

 

I add a Cross Tab Tool and make the Names my New Column Headers and Value the Values for New Columns. I then need to choose a Method for Aggregating Values so I choose SUM.

Horizontal.jpg

 

I then connect my Cross Tab Tool to the TOP of the Drop Down Tool:

 2017-08-14_10-18-10.jpg

 

Manually Set Values - This List Value works very similarly to the External Source, but you can embed the Name:Value into the Drop Down Tool itself. This is a great option if you don't have that many options for the user to pick from and can be added from and removed quickly. The important part of the setup is the Name:Value combination. For example Dan:55, the name Dan will show in the Drop Down, but use 55 as the value to update the tool in the workflow:

 

Manual.jpg

 

 

File Browse in this Analytic App/Macro - This options is another great option when you have a different list of Names and Values to update an app. The other Inputs, like the External Source, will need to have the Name and Value as field names. The great option using the List Value is that you can give the user the option to choose different lists based on what they want to use in the Drop Down:

 

File Browse.jpg

 

See the attached v10.6 workflow for the examples above.

 

By now, you should have expert-level proficiency with the Drop Down Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.

 

Stay tuned with our latest posts every Tool Tuesday by following Alteryx on Twitter! If you want to master all the Designer tools, consider subscribing for email notifications.

Attachments
Comments
Alteryx Certified Partner

Hi Dan. Very helpful blog post. I'm just struggling with using Fields from Connected Tool use case. You said yourself that the data needs to be in the file headers. I'm finding that for your example to work, the actual values (698, 465, etc) have to be the headers. Can you explain?

Community Operations Manager
Community Operations Manager

@PhilipMannering The setup is working correctly for the Cross Tab setup. My apologize for having the wrong screen shot in the post. I am updating that now. Connecting from a tool within the workflow, the Drop Down will read the header as the Name and Value as the same. Unlike the other options where you can designate the Name and Value as different variables.

Asteroid

Hi Dan,

 

I am trying to use the Drop Down interface tool, where the list values are "Fields from Connected Tool".  The difference is that my "connected tool" is a macro input.  For creating the macro, the input is just a simple text input with two fields (Id and Value).  I want the user to select the name of one of the fields that they are passing into the macro.  But, when I go to use this macro, I am prompted with the names of the fields I set up in the creation of the macro, not the fields that I have connected to the input of the macro.  Any thoughts?

 

 

Macro:

macro.PNG

 

Use of Macro:

text.PNG

 

Macro Setup:

dropdown.PNG

 

Community Operations Manager
Community Operations Manager

@jonriddle the "Field Connection" option does not work that way, as the only way that Alteryx will update that drop down is when the workflow is run. You would have to update the Drop Down before the macro gets run. So, you could create a chained workflow. The first workflow would update an output, which in turn you would use that output to update the Drop Down and then the user would see the updated data in that Drop Down.  Really that Field Connection option is there to build an initial Drop Down so user don't have to use external files if that Drop Down doesn't change. If you need to have that be dynamic and update, you will need to create a separate process to update that Drop Down tool.

Meteor

I have a question regarding using the 'manually set values' option. I have my list of values defined, but wonder if there's an option to show a blank value (or a "Select") by default, then require that a choice be made? I hesitate to set a default - the selection made by this box determines which container is enabled and therefore, which workflow is run. 

 

Thank you!

Community Operations Manager
Community Operations Manager

@ColleenH218  There isn't a way for you to add a selection that cannot be used. However, you could setup an Error Message tool to error if they chose the "blank" selection in the Drop Down tool. 

 

 

 

2018-01-18_16-05-49.png

Meteor

Excellent Dan, thank you! That will work!

Alteryx Partner

hi @DanM

 

Thanks for your post on this topic. I am having same trouble as @jonriddle.

 

Could you please give us a sample workflow for your suggestion of adding another workflow as an output to feed into the drop down interactive tool please? Or to be more specific on how to do it please?

 

Many thanks,

Zoey

Community Operations Manager
Community Operations Manager

@ZoeyL1GL,

 

The Interface tools cannot be updated with new data until the workflow is run. Therefore, if you want to update the Interface tool prior to run with new selections, you must create another workflow that would feed the Interface tool with output fields named  Name & Value and the selections and values in those columns. The Interface tool would then call that output from the first workflow and display the new selections. There is no way at this time to dynamically update the Interface tool selections without running the workflow first. The reason we have the connect from another tool available is so that users don't have to manually add selections or have files to reference.

 

Hope that help.

 

DanM

Alteryx Partner

Thanks @DanM,

 

As you suggested, I created a chain workflow before the macro and load the output from the previous chain workflow to the macro. It now works.

 

many thanks!

Zoey 

Atom

I'm not sure what is meant by the "name:value" pair and how to use it. I'm trying to use the "manually set values" option for the drop down. I have only two values that I want the user to select from. The value selected by the user should feed into the filter tool. See screenshots below for my configuration of the Dropdown tool as well as the formula I used in the Filter tool. What am I doing wrong?

Dropdown.JPGI want these two values to show up in the drop down.Filter.JPGI want the business field to be filtered for what the user selected. What am I doing wrong?

Atom

Nevermind, I resolved it. The spelling of "Dropdown" in the formula tool needed to match the name of the tool.

Atom

Hello Dan,

 

I am using an "External Source" option for the drop down it is a sql query from redshift

Select emp_name as Name, emp_name as Value from employee Order by emp_name

 

When I run the app on my desktop I can see the values in the drop down but when I publish the same to the gallery the values disappear and the drop down is not working.

 

I created the data connection in the server and that is what I am using to query.

 

Am I missing something here?

 

TIA!

 

- Sri

Community Operations Manager
Community Operations Manager

@snamburu ,

 

This is only for external source files. I don't think it will work with a database as it would have to be able to query the database before the run. It may be working locally since the time to get the data is much faster than the server. So if the meta data doesn't get updated almost immediately it won't display.

 

If you need to display options from a database, you may want to create a chained app or use the Events tab to kick-off a workflow that would update a file with the Drop Down content. You can create something as simple as a workflow that just had an Input to the database and an Output that creates the file with the Name&Value. The DropDown would then reference that file. The only interface tool that is database ready is the Tree Tool.

 

From Help Documentation

https://help.alteryx.com/2018.4/DropDown.htm

 

External Source
Populates the list with values from a specified file or database connection.
Properties
Specify the file location of the External Source File.
Format the file to contain the Name field in the first column and the Value field in the second column.
The end user selects a name from the list to generate the corresponding value. The file can be a relative path to the saved workflow, but the end user must have the external source file saved to the same path.

Atom

Gotcha!

Thanks Dan, I will try to use other options as you described.

 

Community Operations Manager
Community Operations Manager

@snamburu,

 

Doesn't necessarily mean that it couldn't work. I would make sure that your SQL is working correctly by setting up an Input tool and Output tool and see if you get the Name&Value results. If you get results, it may be like I mentioned with the speed, but if you are not getting results on the server, it may be your database setup.

 

DanM

Atom

@DanM,

I am seeing Name & Values when I use input & output tool.

For now I stored that the output as an external file and import that into the dropdown tool.

 

-Sri