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

Text Box Multiple Values and Single Quotes

Bonediggler
9 - Comet

Experts 

 

Got a little app here where I am updating SQL to generate a report based on user input (text box).  The issue is getting single quotes properly around multiple text values.  The SQL filter is:

where provider in ('9999')

The expression in the action tool is:

if !isempty([#1])
then replace([Destination],'9999',regex_replace([#1],'\n',','))
else replace([destination],"[provider] IN ('9999')",'1=1')
endif

The problem I'm having is if I paste say 2 values into the text box Alteryx reads it as:

[provider] IN ('value1, value2')

I can get around this by putting values in the text box like:

value1'
'value2

But that is really clunky.  What I'm looking for is a way to properly quote these values no matter how the user enters them (type in directly, cut and paste etc).  This seems like a common issue but I have not found any common solutions as yet.

 

Your help is appreciated in advance!

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @Bonediggler 

 

I'd work on this:

then replace([Destination],'9999',regex_replace([#1],'\n',','))

Instead of ',', why not "','" so you insert quotes and a comma to separate them.


Cheers,

Bonediggler
9 - Comet

Excellent - thanks!

Labels
Top Solution Authors