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!
Solved! Go to Solution.
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,
Excellent - thanks!
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |