Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic File Path Help - workflow where users may have different folders in "Full Path"

katief
5 - Atom

Hello,

 

I share workflows with others on my team and typically we save our own versions of workflows with our usernames and file paths in the input and output files. I am looking for a way to dynamically pull in our file paths. I am newer to Alteryx so I don't have the best grasp on terminology, but I will do my best to explain. 

 

To get to the same file, my file path will look something like this: 

 

C:\Users\MyUsername\OneDrive - CompanyName\Team Name\abc.xlsx

 

But my coworkers file path to get to the same "abc.xlsx" file path will be

 

C:\Users\CoworkerUsername\OneDrive - CompanyName\Department Folder\Team Name\abc.xlsx

 

I believe this is because where we have saved our OneDrive shortcuts, but I am wondering if there is a way to set up a file input so it will also work for my coworker(s) when they try to run the folder, even if they have additional steps to get to the file.

 

If the folders were the same, I would be using a text input tool, followed by a formula tool with GetEnvironmentVariable('OneDrive'), which pulls in C:\Users\MyUsername\OneDrive - CompanyName+ the file path "\Team Name\abc.xlsx|||Sheet1", then dynamic input changing the entire File Path, but of course this wouldn't work for my coworker if they have the extra "Department Folder". 

 

Thank you in advance for any help!

5 REPLIES 5
OTrieger
14 - Magnetar

@katief 
Have you try the File Browse Tool? It will let to each user select the desired path

Or you can set a folder on the common server where all the guys have access to.

Luke_C
17 - Castor
17 - Castor

Hi @katief 

 

One thing to consider would be relative paths. This is slightly different than the situation you describe, but if you have the workflow saved in a onedrive or sharepoint spot that is accessible by everyone, you should be able to configure it such that anyone can run it without updating input/output tools. I'm not sure if there's a strong reason for everyone having their own version of the workflow or not, but something to potentially consider.

 

https://knowledge.alteryx.com/index/s/article/How-To-Use-Relative-Paths-1583459124006

 

katief
5 - Atom

@OTrieger

I have not tried it / did not know about it, macro tools feel like rocket science to me. I may have to spend some time getting comfortable with them.

 

It would be nice to have them on a common server, but there are just so many files, and teammates who do not use Alteryx also access them.

 

Thank you for your response! 

 

 

OTrieger
14 - Magnetar

@katief 
The File Browse tool is not a macro, it is a User Interface tool, one of the most common ways to enable the user to select the file that he want to process.

 

Genevieve
8 - Asteroid

Hello @katief 

 

We have a similar set up in my team.

 

I simply have adapted the formula with an IF condition

 

IF GetEnvironmentVariable('username') = 'user1'
THEN 'C:\Users\user1\OneDrive - CompanyName\Team Name\abc.xlsx'

ELSE 'C:\Users\'
+ GetEnvironmentVariable('username')
+'\OneDrive - CompanyName\Department Folder\Team Name\abc.xlsx'
ENDIF

 

 

This way, it applies a variation if the username is different. If the department folder varies per person, you could also use a field which would dictate the variation for each individual, either via another ELSEIF or by plitting the string as above.

Labels
Top Solution Authors