Alteryx Designer Desktop Discussions

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

Can a List Box Tool allow a user to enter multiple values with a separator?

ddiesel
13 - Pulsar
13 - Pulsar

Question: Can I use a List Box Interface Tool to allow a user to input more than one value with a comma separator? The action tool is connected to an in-database filter that filters by client number. There are thousands of client numbers so I don't want to use a list box.

 

Is this possible? Or is there another solution that I'm not aware of?

 

Capture.PNG

 

 

6 REPLIES 6
suli
9 - Comet

Hi @ddiesel,

 

as far as I understand, you would like that

1. user can input multiple customer names/IDs, comma separated to Text Box

2. no need to use a pre-defined list (because there are too many possibilities)

3. this input updates formula, so if user inputs 123, 456 you like the formula like CustomerID in ("123", "456")

 

What I am thinking of, is to update formula (to filter customers) with formula inside Action tool (update value with the formula option), something like

'CustomerID in ('"+ regex_replace([#1], ',\s{0,1}', '","')+'")' so your filter gets desired syntax dynamically.

 

Let me know if you have any questions.

ddiesel
13 - Pulsar
13 - Pulsar

@suli... thanks for your response. I am just getting back to this project.

 

Yes, this is exactly what I need. I haven't conquered RegEx yet. Do you know why I would be getting a parse error at character 15? 

 

I guess it's time for me to learn! I'm going to see if I can figure this out tonight.

suli
9 - Comet

Hi @ddiesel,

 

It was just a sample regex formula.

If you are not familiar with RegEx, I highly recommend one of regex- support websites, I usually use regex101.com (although there are multiple available).

 

Correct formula could be: 'CustomerID in ("'+ regex_replace([#1], '\s{1}', '","')+'")'

 

Hope that helps!

AngieKing
7 - Meteor

Looks like the second response was missing the comma character to be replaced.

 

'ClientNo in ("'+ regex_replace([#1], ',\s{0,1}', '","')+'")'

Add the comma back right before the \s

 

ddiesel
13 - Pulsar
13 - Pulsar

@AngieKing After switching around the single quotes and double quotes, the formula worked perfectly for me!

 

"ClientNo in ('"+ regex_replace([#1], ",\s{0,1}", "','")+"')"

 

Thanks also to @suli for pointing me in the right direction.

mabellebautista
6 - Meteoroid

Hello,

 

I have an error when I tried. I want to add all the checked items by the client in the input data. Could you please share a screenshot of how should I configure the Formula tool and the action tool. Thank you!

Labels