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

Alteryx Designer Desktop Discussions

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

Updating Select Functionality in Multi-Field Tool using List Box

vinayR96
7 - Meteor

Hi All,

 

I'm trying to apply a formula on some Numeric Fields to convert them into dates using a Multi-Field Tool. I want the user to select columns on which the formula should apply. All the remaining fields will be passed as they are.

 

How should I configure List Box and Action tool so that the select functionality in MultiField is updated?

Any ideas?

3 REPLIES 3
CharlieS
17 - Castor
17 - Castor

Hi @vinayR96 

 

This is a fun application for Update XML Actions. So as you've probably figured out, the "Select Tool Mode" setting of the Listbox tool doesn't output what we need, but the "Generate Custom List" can with the right configuration. We're going to build the XML that the Multi Field Formula tool is expecting and directly update the tool's code with an "Update Inner XML" action. 

 

- We start by looking at the XML of the Multi Field Formula tool to see how the field section is encoded in the tool. Here's what it looks like when I have my test values of "Field1" through "Field5" selected:

 

20200710-ListboxMultiField.PNG

- Note that the Multi Field Formula tool should be configured to "All Types of" so we can allow the selection of all fields. Field types may be an issue for your Formulas, luckily the Multi Field formula tool can also change the field type. 

 

- It looks like that section lends itself to being built by a concatenated list of field values. Back in the Listbox tool, I use the follow strings in the concatenation settings:

 

Start Text:

 

<Field name="

 

 

Separator:

 

" /> <Field name="

 

 

End Text:

 

" />

 

 

For example: if we only select "Field4" and "Field5" the Listbox tool will build the following string. Note that the newlines can be ignored. 

 

<Field name="Field4" /> <Field name="Field5" />

 

 

 

Now that we have this ready, it's just a matter of applying it to the right spot in the Listbox tool using an Action tool to update the XML. It's very important to select the "Fields" parent in the XML as the target. Here's the Action tool configuration:

 

20200710-ListboxMultiField2.PNG

 

That's it. Check out the attached wizard to see this in action and let me know if you have any questions. 

vinayR96
7 - Meteor

Hi @CharlieS,

 

Thanks a ton for your help! You not only solved my problem, but also taught me something new.

Cheers!

 

-Vinay

Ahmad_Syed
6 - Meteoroid

i dont quite understand why we type in [#1] in the formula to generate new XML: box

Labels
Top Solution Authors