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).
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?
Solved! Go to Solution.
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...
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.
NB: attached as workflow to update, it is actually an app, if you rename the extension
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?
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:
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)