This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
You deal with paths every day to browse to your data. This topic delves into detail about paths, defining the different types, and how Alteryx manages them.
Paths and pathnames
A path is a slash-separated list of directory names followed by either a directory name or a file name. A directory is the same as a folder.
E:\Data\SavedThings (path terminating in a directory name)
E:\Data\SaveThings\workflow.yxmd (path terminating in a file name)
On occasion, you may see the term pathname or path name. Path, pathname, and path name are synonymous.
Forward versus backward slashes
The Windows convention is to use a backward slash (\) as the separator in a path.
Backward slash in scripting
Programming languages that have their roots in UNIX and the C programming language, such as Python, treat the backslash (\) as the escape character. For example, \n signifies a carriage return. Since paths can contain backslashes, you need to prevent backslashes from being used as the escape character. A common technique is to escape the backslash, as follows:
thePath = "E:\\data\\london\\gherkin"
Another way is to convert paths into Python raw strings using the r directive, as shown below. This instructs Python to ignore backslashes.
thePath = r"E:\data\london\gherkin"
Absolute and relative paths
Absolute, or full, path
An absolute, or full, path begins with a drive letter followed by a colon, such as D:.
A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy. A single dot represents the current directory itself.
In the example directory structure below, assume you used Windows Explorer to navigate to D:\Data\Testing\App. After navigating to this directory, a relative path will use D:\Data\Testing\App as the current directory (until you navigate to a new directory, at which point the new directory becomes the current directory). The current directory is sometimes referred to as the root directory.
If you wanted to navigate to the Con directory from the current directory (App), you could type the following in the Windows Explorer Address box:
Windows Explorer would navigate to D:\Data\Testing\Con. A few more examples using D:\Data\Testing\Con as the current directory are below:
. (D:\Data\Testing\Con - the current directory)
Absolute and relative paths in Alteryx
When working on an Alteryx workflow, you can specify that paths will be stored as relative paths. To set this option, look under the Options menu > Advanced Options > Workflow Dependencies. Here, you can specify whether to store absolute, relative, or UNC paths.
When you save the document with relative paths, the application converts paths into relative paths (using the dot/double-dot notation) relative to the location where you stored the document (the current directory). For example, if your document is stored in
and one of the files you use in your workflow is
setting the "All Relative" options would give the following:
If you click the "All Absolute" button, Alteryx converts the stored relative path from the dot/double-dot notation back into the absolute path representation.
Only paths on the same disk are converted
Relative paths cannot span disk drives. That is, if the workflow is on drive D, you cannot use relative paths to navigate to a directory on drive E. When you store your map document using relative paths, only those paths that are on the same drive are converted.
Why use relative versus absolute paths?
Using absolute paths, the following are true:
You can move the workflow anywhere on your computer and the data will be found when you reopen the document or tool.
On most personal computers, the location of data is usually constant. That is, you typically don't move your data around much on your personal computer. In such cases, absolute paths are preferred.
You can reference data on other disk drives.
Using relative paths, these adjustments are necessary:
When moving a workflow, you must also move the referenced assets (data, macros, etc.).
When delivering workflows to another user, relative paths should be used. Otherwise, the recipient's computer must have the same directory structure as yours.
For example, consider the directory structure below. In this example, D:\Tools\Prod\mod.yxmd contains a tool that uses D:\Tools\Storage\output.txt.
Using absolute paths, if you moved the workflow from D:\Tools\Prod\ to a different disk, such as E:\Final\Prod, ArcGIS will find D:\Tools\Storage\output.txt and everything will work fine. If, however, you use relative paths, Alteryx will not find the file and the workflow will error. You will have to open the workflow and enter the correct path to the file.
On the other hand, if you use relative paths, you can simply copy the folder D:\Tools anywhere on anyone's computer and everything will work. This won't work if you use absolute paths, because the recipient could copy the folder to F:\NewTools and the path D:\Tools\Storage\output.txt won't exist on their computer.
Relative paths cannot span disk drives.
Absolute paths work best when data isn't moved, which is typical for disks on a personal computer.
Relative paths work best when you're delivering documents and data to another user.
Relative paths use dot/double-dot (. and ..) notation. You can enter relative paths with this notation in Windows Explorer or at the Windows command prompt.
Relative paths are relative to a current directory, which is the location of the workflow.
UNC stands for Universal (or Uniform or Unified) Naming Convention and is a syntax for accessing folders and files on a network of computers. The syntax is as shown:
\\<computer name>\<shared directory>\
followed by any number of directories and terminated with a directory or file name.
The computer name is always preceded by a double backward slash (\\).
In UNC, the computer name is also known as the hostname.
These are a few rules for UNC paths:
UNC paths cannot contain a drive letter (such as D).
You cannot navigate to directories above the shared directory.
In Alteryx, you can use a UNC path anywhere a path is requested. This is particularly advantageous for shared data on a local area network (LAN). Data can be stored on one computer and everyone with access to the computer can use the data, as long as the computer is not turned off or removed from the network.
In Windows, you can share a folder so that other users on your local area network can access it. In Windows Explorer, right-click a folder, click Properties > Sharing > Share then follow the instructions on the dialog box that opens.