Create field from file name using directory input
- 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 have reports auto generated and placed on a shared drive that I am bringing into a workflow using the directory tool. Each file name has a date the file was created however the date is not available on any sheet. Using the Input Data tool I can choose to Output File Name as Field. However I cant seem to do this when using the directory input, Googling and searching the community has not worked so far. Is this possible? If not what would be the best way to accomplish this? I will have daily files for a six month project that needs to be updated daily. Thanks
Solved! Go to Solution.
- Labels:
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The Directory Tool already outputs the file name as a field without any configuration. https://help.alteryx.com/current/en/designer/tools/in-out-tools/directory-tool.html
FullPath |
V_WString |
The entire path of the file. This includes the drive, directory, and file name. |
FileName |
V_WString |
The name of the file. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ok I see where that is outputted, however it is not creating a field in my data sets. In my example I need each file to be modified with the file name as a field so I can then alter that field to show the date the data was from.
I tried to do it as shown below but it does not add the file name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@BrianHausman in your Dynamic Input template config, do you have "Output File Name as a Field' selected? For .xlsx files, it's typically option #5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Alternatively, if you want to go down the batch macro route instead of dynamic input, you can configure your dummy data set as part of your batch macro to output the file name or full path. From there you can get it as a field in your macro output.
More information here:
https://knowledge.alteryx.com/index/s/article/The-Ultimate-Input-Data-Flowchart-1583459854309
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
