Filepath constant/global var
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Jonathan,
Can the workflow constant be added in a render tool or an input tool?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
external workflow
Batch macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
