Dynamic Path using ..\
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I've seen some people use ..\ (dot dot backslash) in file paths to create dynamic inputs and outputs, but I can't find any documentation or questions for how ..\ functions or why you might use multiple of these in a row, such as ..\..\..\dir\file. So, my question is:
How is ..\ defined?
Specifically, I'm curious about:
- whether this is relative to the directory of the workflow being run
- whether multiple ..\ indicate a required number of subdirectories
- whether, like with *, the ..\ can be mixed between specific text (eg ..\OneDrive\..\Project XYZ\file.csv) and this is intended usage
- what happens when multiple files meet the criteria
Solved! Go to Solution.
- Labels:
- Dynamic Processing
- Input
- Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Inactive User,
The starting point for the relative path is the location of the Alteryx workflow. I hope my explanation is sufficient for you to understand it better.
- whether multiple ..\ indicate a required number of subdirectories yes it will show information how many directories up the workflow need to look for a file
- whether, like with *, the ..\ can be mixed between specific text (eg ..\OneDrive\..\Project XYZ\file.csv) and this is intended usage - I don't think it will work.
- what happens when multiple files meet the criteria. I don't think it is possible as the information about the relative path can only show one specific place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @Inactive User ,
Relative pathing is always relative to the workflow you are running. And if the workflow references a macro, the relative paths within the macro will be referenced to the macro path, not the workflow. Therefore if you have a workflow for example on:
C:\Users\IronMan\Documents\Mark42\Myworkflows
..\ will look for files on
C:\Users\IronMan\Documents\Mark42
If you add another ..\..\ it will look for files in
C:\Users\IronMan\Documents
For example
..\Mark45\Myworkflows\Secret_macro.yxmc
Will look for a macro on
C:\Users\IronMan\Documents\Mark45\Myworkflows\Secret_macro.yxmc
3.- Never used it before
4.- Cannot think of an example where two files would meet the criteria, this would mean that two files have the same name on the same path?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Inactive User
What both the other commenters have implied is that ..\ references the directory above the current directory. Move up one directory for each "..\", as in the first part of @afv2688 explanation.
To answer your question 3, "..\OneDrive\..\Project XYZ\file.csv)" is valid and would move as follows assuming this directory structure
parent --- Current
--OneDrive
--Project XYZ
1) ..\ moves up to parent
2) OneDrive\ down into OneDrive
3) ..\ Back up to parent
4) Project XYZ\file.csv down into Project XYZ
If you follow this you'll see that the directory 1) is the same as directory 3) so any sequence like ..\directory\..\ is redundant and can be removed and replaced with a single ..\
Question 4. There is never any ambiguity since the paths will always resolve to a unique location on the drive or will be invalid.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @danilang,
I wasn't aware that the 3 scenario is valid.
Thank you for a detailed explanation.
@Inactive User there is also a help page on this topic. It might be useful for you to visit it:
https://help.alteryx.com/current/designer/workflow-dependencies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have been able to get macros to use the working directory of the parent workflow before. For some reason, this has now stopped working and I'm trying to find out how to get it working again. I have a generic file reader that reads a file in using a file reference relative to the workflow location.
