Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Filepath constant/global var

StephenF
8 - Asteroid

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.

10 REPLIES 10
fmvizcaino
17 - Castor
17 - Castor

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

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @StephenF,

 

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

 

image.png

 

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

 

image.png

 

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

StephenF
8 - Asteroid

Hi Jonathan,

 

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

 

part.jpg

OllieClarke
15 - Aurora
15 - Aurora

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 workflowexternal workflow

Batch macroBatch macro

Jonathan-Sherman
15 - Aurora
15 - Aurora

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?

 

image.png

 

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

 

Regards,

Jonathan

StephenF
8 - Asteroid

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.

OllieClarke
15 - Aurora
15 - Aurora

@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..

danilang
19 - Altair
19 - Altair

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

 

userconst.png

 

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

Jonathan-Sherman
15 - Aurora
15 - Aurora

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

Labels