Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

User Constants changed from intercface tools

patrick_digan
17 - Castor
17 - Castor

Is it possible to update a user constant from interface tools? Some of my apps can become a bit scattered simply because one interface question needs to be connected to 5+ tools in a module. This means adding 5+ action tools and a lot of connections. As an alternative, it would be great if there was a way to simply update a user constant with the interface tools. Then I wouldn't need all the action tools and i could just have the user constant in the various tools that need updating. 

5 REPLIES 5
s_pichaipillai
12 - Quasar

@patrick_digan

 

I think Alteryx Constants are Static not Dynamic.

Why don't you use a formula tool and update your Question from App Interface and use your Updated value in Formula to other tools in the workflow?

 

AdamR_AYX
Alteryx Alumni (Retired)

Patrick,

 

There are a couple of options available for you here:

 

1.  If you want to use the answer to an interface question in a formual expression soemwhere simply connect the interface question directly to the Q input on the tool:

 

Qinput.png

Then the answer appears in the formula builder and can be used directly:

 

Formula builder.png

You can then make the connections to the Q wireless and the clutter is gone :)

 

2.  There is also a more hidden and less supported method of referencing questions directly without connecting the interface tool up at all.

 

So

 

No connection.png

And

 

Formula builder Perc.png

 

With this method you surround the interface name with % like so %Question.<<Interface tool name>>%.  One thing to note with this method is the answer to the question is directly substituted in place before the formula is parsed for correctness.  So you will notice this time the question is inside the double quotes of my formula.

 

Hope one of those methods helps you.

Adam Riley
https://www.linkedin.com/in/adriley/
patrick_digan
17 - Castor
17 - Castor

Thanks for the replies! Adam, both of those methods are exactly what I was looking for! For what it's worth, I wanted to pass along that your second method of referencing the question without connecting it did not work in debug mode when I tried it (although it worked when I ran the wizard normally).

PamW
Alteryx Alumni (Retired)

if you wanted to test it using run you can fill in a value for the question in the workflow constant area, note that each question on the canvas is a constant you can set on the workflow tab. 

 

theanswerwas.png

You may also want to change the name of the question as it appears on the workflow tab and you do this by changing the name on the tool annotations pane. The default name shown is Text Box (4).

pamW
dralban
7 - Meteor

AdamR, would the second, less documented method, be usable for population of the Pre-Create SQL Statement in Output Data tool? I have a Text Box that asks for a ME Date, named MEDate, then in the Pre-Create part I need it to execute:

 

DELETE FROM SCHEMA.TABLE WHERE MONTH = %Question.MEDate%;

 

However it is giving me a syntax error at month position...

Labels