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

How to assign dynamic workflow constants?

sarunas_stulga
5 - Atom

Hello,

 

I would like to know if there is a way to assign constants in Alteryx that change each time I run it. I require the variables to change based on the data inputs. For example, each month I add an additional month of data to the dataset and I want the workflow to make the whole period as a constant. I require it to help with the Dynamic filters. 

 

I know I can solve the issue by using the Interface tools, but I do not know if the dynamic assignment of workflow constants is an option in Alteryx. 

8 REPLIES 8
afv2688
16 - Nebula
16 - Nebula

Hello @sarunas_stulga 

 

You can do this by clicking on the canvas, then on the configuration window click on Workflow and on the '+'.

 

You will be able to type the name and the value for the constant

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

sarunas_stulga
5 - Atom

Would it be possible to define the value as the output of a specific tool on the canvas?

afv2688
16 - Nebula
16 - Nebula

Hello @sarunas_stulga ,

 

As far as I know you cannot change the value of a constant whithin a workflow.

 

If you need the value in the same canvas on a different tool then I would recommend you using another system, for example, using append tool to only get the selected value into the table you are performing your calculations.

 

If you would want an example of that I could create one.

 

Regards

amti
7 - Meteor

Also,

 

Is there a way to change a user constant at runtime, but in Alteryx Server? Since it's an user constant, I would expect a context menu that would allow me to change that user constant on runtime, like it happens already on other Integration tools. Is this possible? This would be a great way to reuse the same workflow, for different values of the same constant.

E.g.: I want to onboard a table, perform the same changes, and output it. The table_name changes, but thw workflow is the same. If I want to have specific workflows to load 10 tables, I would have 10 workflows with different values for that constant. Or is it even a better way to do this and still "separate" each independent execution of the workflow?

afv2688
16 - Nebula
16 - Nebula

Hello @amti ,

 

if you are going to change it on each workflow why not have a numeric interface tool? Wouldn't that be the best solution in this case?

 

Regards

amti
7 - Meteor

Hi,

Actually that's what I did: I passed from having user constant to input text box or any other interface, the problem with having interface is that I cannot schedule it in Alteryx Server and change the parameters/question for each run ...if it's only for adhoc execution, when you hit "Run" it asks you for parameters/"Questions", if you click on "Schedule" those parameters are not possible to edit ...yet (this is a feature that has been requested for 2 years, at least, from what I can read here in the Community 😶 ).

franc1s
8 - Asteroid

I am looking for exactly the same implementation. I have dynamic "workflow constants" that I want to set, so that they are easily available in the rest of the workflows.

 

I dont want to access the parameters through user dialog for exactly the same reason as you, which is, they interfere with running the workflow unattended.

 

I do feel that it should be a lot easier to be able to add/edit  the constants at run time. I am not sure how this could be directed as a feature request...

 

I have worked with another solution that loads in parameters based upon an input file, this continues to be cumbersome as the parameters are used in various places in the workflow. In the end I ended up using "wireless connections" to prevent connection lines all over the place.

 

 

 

 

franc1s
8 - Asteroid

Capture_param.JPG

This certainly doesnt cover all scenarios, but, I think it might be helpful sometimes. You can load the parameters from an external file of course. The downside is what I mention in my earlier post above.

 

I am interested to hear from others.

 

 

Labels