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 Knowledge Base

Definitive answers from Designer Desktop experts.

How To: Use Relative Paths

ChadM
Alteryx Alumni (Retired)
Created

A relative path is in relation to the location of the App on the users system. For the examples below, let’s assume the Apps are located at C:\Users\ach\Documents\Alteryx
 
                Relative Path                     Absolute Path                                                                                                   Explanation
1)      input.yxdb                          C:\Users\ach\Documents\Alteryx\input.yxdb                               Current directory
2)      .input.yxdb                       C:\Users\ach\Documents\Alteryx\input.yxdb                               Current directory (this is the current directory notation I use)
3)      .inputs\input.yxdb        C:\Users\ach\Documents\Alteryx\inputs\input.yxdb                 Sub-directory of current directory
4)      ..input.yxdb                     C:\Users\ach\Documents\input.yxdb                                                Back one directory
5)      ....input.yxdb                 C:\Users\ach\input.yxdb                                                                         Back two directories
6)      ......input.yxdb            C:\Users\input.yxdb                                                                                     Back three directories
7)       
 
If you have an App that runs from a user’s desktop that uses data shared on the network, you would want to use an absolute path for the shared data and the rest of the inputs and outputs could use relative paths.

The simplest way to set relative paths is to select your input/output files using absolute (full paths) file paths. After the inputs and outputs have been defined, from the Options menu, go to Advanced Options and select Workflow dependencies. From the Workflow dependencies window (shown below), click the “All Relative” button in the bottom left. This will convert everything to relative paths.
 

 
In addition to selecting “All Relative” for the entire module, you can also click on the “Edit” buttons and change individual input/outputs to relative paths:
 

 
In the screenshot above, you can check which you want modified and then click the “Relative” button to set the selected input/output tools to relative paths.

Huge thanks to Zach for his contribution this week, until next time!

Chad
Follow me on Twitter! @AlteryxChad 

Comments
Paul-Evans
9 - Comet

Another use case: workflow is saved in the Alteryx\inputs folder, but the file is in the sibling folder, Alteryx\inputs2. Combining options 3 & 4 above made this work.

 

3&4)      ..inputs2\input.yxdb        C:\Users\ach\Documents\Alteryx\inputs2\input.yxdb                 Sub-directory of back one directory

 

I have a project with standard "Transformation" and "Output" folders, and I was able to use this method to have a relative path for my output tools to the "Output" folder based on my workflow in the "Transformation" folder.

sclark025
5 - Atom

Is there a way to make yxwv files relative references? I'm trying to send an app with supporting input files to someone with a yxwv to populate the app but the yxwv files have the file path from my computer.

RichC
7 - Meteor

In the Interface Designer's "Open Debug" option, I find that my output files that use a relative path are re-routed to temp file paths.

 

Is there a way to get the debug mode to use the true relative path that was provided?

 

KOBoyle
11 - Bolide

I was attempting to go back two directories and then traverse down a different branch for which none of the examples listed worked. The tip to use Options > Advanced Options > Workflow dependencies with All Relative button gave me the correct path.

 

..\..\<branch2>\<filename>.yxdb

 

 

 

 

 

cking6178
8 - Asteroid

Good stuff @ChadM , thanks for sharing!

 

Assume this works when the root file path changes, but the folder structure remains - i.e. you go from E:\Top Folder\Next Folder\etc to R:\Top Folder\Next Folder\etc?

alexandramannerings
8 - Asteroid

@cking6178 Yep, the idea is that it mimics the relative structure rather than the absolute names. 

htrivedi123
8 - Asteroid

good explanation, thank you

NataliiaC
5 - Atom

Hi, I'm having a little trouble setting a relative path. 

 

The workflow is located at: ....Project\Alteryx

The files should be pulled from: ...Project\Org\01 - Mat. Moves\Canada\ 

 

Having Alteryx and Org being sibling folders.  

 

Is there a way to configure in such a situation?

 

 

 

Paul-Evans
9 - Comet

Hi @NataliiaC

 

I think it would be:

..Org\01 - Mat. Moves\Canada\ 

One dot would be in the Project\Alteryx directory, the second brings you to the Project\ directory (example #4 in the post).

Then Org\01 - Mat. Moves\Canada\ would bring you to the appropriate sub-directory (example #3 in the post).

NataliiaC
5 - Atom

Thanks, @Paul-Evans !

Works like a charm!

mebhagat
5 - Atom

Firstly, thank you for the explanation above.

 

This was a great example,  I wanted to confirm on some points -

a. Let's say if there are 2 folders with the same level structure having the same filename - 

Folder 1 - C:\Users\megh\alteryx\workflow1.yxmd

Folder 2 - C:\Users\megh1\alteryx1\workflow2.yxmd

 

Now, the workflow1 needs a file input which is stored in both the locations, lets say

C:\Users\megh\alteryx\input

C:\Users\megh1\alteryx1\input

 

Then the workflow1 would take take which file when ran? Is there anyway by which I can tell my workflow1 that take the one stored in your directory and not the other one when I make the paths relative. I have seen that sometimes the workflow saves the relative path to the lowest level of the path, that is just the file name. How to tell Alteryx that I want to also mention few folder names to make it more specific? 

 

Thank you!