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 to Input data to SQL

Luca
8 - Asteroid

Hi!

 

I am trying to feed an user ID in the Input Tool via a text box. 

 

The input tool is supposed to run a simple SQL query:  Select * From CC_USAGE Where end_user_Id = 'xxx'

 

xxx should be replaced with the Used ID entered in the text box, in a format like 123456

 

When I run the app, I can see that xxx is replaced but still I do not have any outcome result. 

 

Capture.JPG

 

 

 

Capture.JPG

 

Thanks a lot!

7 REPLIES 7
MichalM
Alteryx Alumni (Retired)

Hi @Luca

 

You're doing everything right. The only thing that I can think of is the actual SQL - have you tested this outside of Alteryx? Could it be that the user ID is a number rather than a string? In which case you'll need to get rid of the single quotes.

 

Thanks

Michal

Luca
8 - Asteroid

@MichalM unfortunately, I have already tried that and it doesn't work. So I'd say that the ID is a string.

 

Besides, if I populate the SQL query in the Input tool with an ID, it works fine. But as soon as I try to use the text tab  I get that error. 

 

 

 

MichalM
Alteryx Alumni (Retired)

Why don't you try the following 

 

1.Use the Text input tool to bring the user ID into your workflow - the text box will be updating this cell

 

Screenshot_1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Use the value to update your where statement using dynamic input

 

Screenshot_2.png

 

LindaT
Alteryx
Alteryx

Given your limited workflow, you would also need to make a change to the Interface Designer properties to include the "browse tool" in your output.  When an App is running all browses are disabled unless you explicitly call the out for viewing.  

 

Luca
8 - Asteroid

Brava @LindaT! It works now :))

Skytop
5 - Atom

Hello,

i realize this is an old post. hoping my question will be seen 🙂

Can you share the solution that worked for you?

I have a similar use-case. I need to be able to pass a user-input value into the where clause of the SQL query.

so far, I have not been able to get it to work.

Luca
8 - Asteroid

In my case worked ticking the Browse box as indicated in LindaT's screenshot above.

 

I thought that my workflow wasn't producing any result while the issue was that I could not visualize them. 

Labels
Top Solution Authors