community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

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

Quasar

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

 

 

Alteryx Partner

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.

Quasar

@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.

Alteryx Partner

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!

Highlighted
Meteoroid

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

 

Quasar

@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.

Labels