I’ve been writing a lot about apps in the last few weeks. I started with a simple app that became more complex. This post explains how to build Alteryx apps that open and close containers with radio buttons in order to direct data thru a workflow. Read more to learn how.
Blog or Video
If you’ve read my app posts over the last few weeks, you know I have been working on an app that allows users to select an operator and query data for that operator. Being able to select the operator was the first requirement. The second requirement was to query either a specific date range or pull all data for that operator. I accomplished the second requirement with Radio Button interface tools that told Alteryx to open or close a container based on the selection. One container would query all data, and the other container would query only a specific date range. Here’s a look at the user interface and the radio buttons.
Now, I wasn’t able to screenshot my entire workflow without making it tiny, but notice how my Action tool connects to the container. What happens is that the user makes a Radio button selection that translates to true or false. The Action tool contains an expression with a true or false result that tells the container to open or close based on true or false. Keep reading to see the details.
Using Radio Buttons
This was my first time working with radio buttons in Alteryx, and they do NOT at all work the way I expected them to work. I expected one tool where you configure the options for all the radio buttons. Instead, you need one tool for each radio button. Then, direct the workflow to do something if/when that radio button is selected.
The screenshot below shows how I used two Radio button tools for my two options. They are each connected to an action tool.
Below, you can see the Radio Button tool config. The main configuration is the text the user will see in the interface. The second piece of configuration is to check the box that says “Collapse Group When Deselected“. I worked with Alteryx support on this, and I was told that it wouldn’t work unless one of the Radio button tools had this box checked. It doesn’t matter which one. Based on the Help description, I don’t understand why it would be required. If you know, please comment!
Next, I connect the Action controls to the containers and configure the Action control. The Action control will disable the container when the expression show at the bottom is false. Now, I’m only showing on Action control configuration screenshot. The configuration is exactly the same for each of my Action tools.
After setting this up, you can run the app in Debug mode to actually see which container closes for a given radio button selection. Check out the YouTube video for a demonstration.
In summary, the user selection of a given radio button translates to true or false which then translates to open or closed for each of the containers. This is how I direct the workflow to query either a specific date range or all data. Now you know how to open an close containers in an Alteryx app!
Content created with Alteryx 2020.3.