Alteryx Designer Desktop Discussions

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

How to Use the Selection Made in One ListBox to Alter the DropDown In A Subsequent ListBox

artzee1556
8 - Asteroid

Hello - 

 

I have a scenario that I can probably make work with a chained app but wondering if it is possible to avoid that route and keep the logic all inside the same app. I have two name/value lists that are prepopulated from A LOOKUP table in the database: (1) a list of distinct state codes and (2) a list of distinct city names prefixed by a state code. So, for example the STATE Listbox would contains a name value pair of NJ/NJ and the CITY Listbox would contains a series of City name/value pairs prefixed with the State: e.g., NJ-Newark\NJ-Newark, NJ-Paterson\NJ-Paterson, NJ-Roseland\NJ-Roseland, etc. All the other State/City combinations would of course be in the City ListBox and as a result it is a VERY long list. I'd like to dynamically limit what is displayed in the CITY dropdown based the selection made in the STATE ListBox.

 

I thought that perhaps there was a way to pass the value from the STATE ListBox into the CITY ListBox query. Right now the CITY ListBox query looks something like: "xxxxx|||SELECT NAME, VALUE FROM LOOKUP_TABLE WHERE NVTYPE = 'CITY' ORDER BY NAME". That works fine but is it possible to include the STATE selection made by the User previously in that query so it looks something like: "xxxxx|||SELECT NAME, VALUE FROM LOOKUP_TABLE WHERE NVTYPE = 'CITY' AND VALUE LIKE (the state code selected by the user in the STATE dropdown) ORDER BY NAME". 

 

It sounds reasonable and I think that it is possible to reference what was actually selected in a different ListBox but just don't know how. 

 

Any help would be greatly appreciated.

 

 

 

2 REPLIES 2
afv2688
16 - Nebula
16 - Nebula

Hello @artzee1556,,

 

If you want to avoid using chained app for that specific example I would maybe recommend you to use a tree tool.

 

On the sample workflows you will be able to see how they work. Maybe the easiest one to set up would be the "Custom File/Database" one.

 

The example is availabe on the following path:

 

Help -> Sample Workflows -> Learn one tool at a time -> Interface -> Tree

 

Regards

artzee1556
8 - Asteroid

Thank you for the quick response. Stuck on one thing. I am assuming there is no easy way to create the actual tree data source that has the Name/Key values. Is there standard SQL I can use to create the keys: e.g., 01 - Alaska, 01001 = Anchorage, etc., etc.? My state codes are alpha (AL) as are the CityNames. Thanks again. Art. 

Labels