Open and Close Containers with Radio Buttons

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

My App

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!

Alteryx Version

Content created with Alteryx 2020.3.

Other Super Useful Alteryx Content

2 thoughts on “Open and Close Containers with Radio Buttons”

  1. Julie,

    Thanks for posting videos and content. It has been difficult to find current videos and material on apps. I am new to Alteryx and I am building an app that I thought was going to be fairly easy and I have run into a bottle neck. I have reached out to support but they have suggested getting a consultant. Not going to happen since my company won’t pay. Do you know if in the app if you can “on success: change the Analytic app dynamically”? I will have possibly 8 different containers and I want to be able to call another app on success that is related to the container.

    Thank you,
    Chris Ilmberger

    1. Well that’s really frustrating. What you are describing sounds like chained workflows or chained apps. How you go about this will probably depend upon your use case. Do you need to call another app or another workflow. If it’s just a workflow, you can use the running/conditional runner from CReW macro. If it’s another app that’s probably going to be more complicated, and I would start by merging the two to have just one app.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.