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

Input Data and Environmental Variables

ejogion
7 - Meteor

Is there a way to use environmental variables in Alteryx Designer in the Input Data tool?

 

Something like this, where the Input Data points to a file on the desktop no matter what user uses the tool. 

 

 

C:\Users\%userprofile%\Desktop\Countries.xls

 

5 REPLIES 5
KaneG
Alteryx Alumni (Retired)

Hi @ejogion

 

That will not work directly, however what you can do is have a text input with 1 cell called [EnvVar] and the text being "USERPROFILE".

 

That then feeds into a formula tool:

 

[Path] = 'C:\Users\' + GetEnvironmentVariable([EnvVar]) + '\Desktop\Countries.xls'

 

Feed that into a Dynamic Input Tool to change the FullPath.

 

Kane

ejogion
7 - Meteor

This is correct and solves my question. Thank you. 

 

The only problem is the data I have coming in has different schemas. The macro I was building is supposed to fuzzy match column headers, standardize the naming using a master file, and union the files. There's no way to change the template with every input right? The macro Action tool doesn't show anything to indicate this.

 

 

 

KaneG
Alteryx Alumni (Retired)
Indeed, you can't change the template in the DI tool. You would need a batch macro if the schema is changing.
The file name would be the control parameter updating an input tool and you will definitely have to change the output settings on the interface designer.
ejogion
7 - Meteor

Can the DI tool assume the same template as what's being input to it? In other words, do you have to specify the template? 

KaneG
Alteryx Alumni (Retired)
Yes, you have to specify the template.
Labels