Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Making the UI dynamic in interface designer

cgoodman3
14 - Magnetar
14 - Magnetar

I'm looking for some help to make a batch macro to import several files of the same type a bit more dynamic by allowing the user to select some additional options. It's similar to this weekly challenge but also to allow the user to set some file type specific options, for example if the user wants to bring in xlsx files then they can choose which line the data starts on, or if they bring in a csv file choose the delimiter.

 

I've been able to mock something up using the method @MarqueeCrew provides a solution, which uses radio buttons to collapse the other interface inputs (as per below).

 

Interactive Results.gif

 

 

However, (as in I can't seem to get this to work) by using radio buttons it seems to lose the ability to update the value of the '@FileFormat - value' (i.e. set it ="0" for csv and ="25" for xlsx) and I believe this is required to enable the FormatSpecificOptions, which is where things like the delimiter can be set for csv files.

 

I can, in part, update the value for the FileFormat - value using a dropbox box, however this approach loses the collapsable containers which work with radio buttons.

 

Therefore does anyone know how to make the UI more dynamic or how using a radio button can update the FileFormat - value?

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
5 REPLIES 5
cgoodman3
14 - Magnetar
14 - Magnetar

After a bit of playing, I've thought up a solution, based on the examples given for the radio button in Designer and that's to put the two versions of the file input macro into different tool containers and activate the tool container based on the user selecting a specific radio button...

 

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
JoeS
Alteryx Alumni (Retired)

I believe you have come to the right conclusion about using different tool containers, as that is more manageable and potentially easier to understand.

 

However, I thought I'd answer the initial question if in future you aren't sure how to do it another way, as you can achieve what you were asking.

 

What you will need to do is use "Update Value with Formula" within the action tool, rather than the default update value.

 

This will enable you to insert the value you wish into the FileFormat part of the input tool. Rather than updating it with the boolean value from the radio group.

 

Workflow.png

 

NB: attached as workflow to update, it is actually an app, if you rename the extension

cgoodman3
14 - Magnetar
14 - Magnetar

Thanks @JoeS - I've never used the update with formula option, so I've learnt something new with that.

 

Looking at your app, when using debugging mode I can see that it is changing the value to 25 / xlsx as expected.

 

To practice/understand it in more detail, I just set up this simple interface where there's two radio buttons to update a text input with either 25 or 50, depending on the button selected. But it always returns 50, so what am I doing wrong with that set up?

 

Capture.PNG

 

 

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
JoeS
Alteryx Alumni (Retired)

Sorry, that's my fault for not explain it properly and not giving you a good enough example.

 

You'll need to combine it with a condition tool as well.

 

This way the formula in the action tool only takes place when the condition is met:

 

2019-10-03_09-46-54.png

 

What was happening with your app is both action tools were still taking place, and it happened to be that 25 was updated first, then 50 after (due to tool id's)

cgoodman3
14 - Magnetar
14 - Magnetar
Great thanks for that, I’ll have a play (and importantly hopefully some useful learning ahead of my automation master exam in just over a week!).
Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
Labels