Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Filepath constant/global var


I want my first step in a report to define a filepath for my workflow to be used in many inputs/outputs.


My workflow takes in 2 inputs and render/outputs 14 files.


Is there a way to have a global var which contains the filepath and is not a filepath trapped in a column.


I note the input data tools cant take an input themselves.

Alteryx Certified Partner

Hi @StephenF ,


Instead of using global variables to change all paths automatically, you could be also using workflow dependencies in order to change all paths at the same time.



Fernando Vizcaino

Alteryx Partner

Hi @StephenF,


You are able to create workflow constant variables in the "workflow" tab of the configuration pane shown below:




These variables can then be referenced at any point in the workflow as a standard field shown below:




If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.





Hi Jonathan,


Can the workflow constant be added in a render tool or an input tool?



Alteryx Partner

Hi @StephenF I don't believe it can. I would go with @fmvizcaino's answer, or you could package your workflow as a batch macro, and then feed the control parameter with the filepath you want in the external workflow. 

OllieClarke_0-1574940490782.pngexternal workflow

OllieClarke_1-1574940513894.pngBatch macro

Alteryx Partner

Hi @StephenF,


I don't believe it can be added into the render tool or input tool filepath, however we modify the file path in the tool?




If this solves your issue please mark the answer as correct, if not let me know!





Thanks. I don't think that will work.


I want a single place where I define the path and use it in multipart fullpathname construction.


I've submitted an idea on this subject.

Alteryx Partner

@StephenF Will turning your workflow into a macro work? It doesn't actually need to be a batch macro, you could just use a text input to define your filepath for the entire workflow. You can use the 'update value with formula' option in the action tool if you want to mess with the filepath you defined..


Hi @StephenF 


In almost any configuration box including the "Output File:" in the render configuration, you can reference a user constant by the following syntax 




if your path is defined in a user constant called FilePath you should be able to use 






At runtime, %User.FilePath% will be replaced with the value from the constant.


See here for more ways to use and reference workflow constants



Alteryx Partner

@danilangthats amazing! You learn something new everyday!in that case @StephenF @my original post of creating the workflow constant should work for you