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.
Solved! Go to Solution.
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.
https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/Workflow-Dependencies/ta-p/49696
Best,
Fernando Vizcaino
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.
Regards,
Jonathan
Hi Jonathan,
Can the workflow constant be added in a render tool or an input tool?
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.
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!
Regards,
Jonathan
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.
@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
%Type.ConstantName%
if your path is defined in a user constant called FilePath you should be able to use
%User.FilePath%\outputfile.csv
At runtime, %User.FilePath% will be replaced with the value from the constant.
See here for more ways to use and reference workflow constants
Dan