Pulling File "Content Created" date into Alteryx
- 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
Hi everyone,
I am trying to pull in the "Content Created" date into Alteryx as I have a directory of over 30+ files and created a batch macro to avoid schema issues. One thing I need to do is perform trend analysis, in which I need the original day the file was created. At first, I tried using the "Date Created", but noticed that this is showing as the day that I downloaded the files from the internet which is not what I need.
Does anyone know if there is a way to get the original Content Created date for files in a directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hey @jason79121
After having a look online - i think this would require a bit of Python programming.
That data is not file-system metadata, its metadata of a specific file types header (more here https://stackoverflow.com/questions/51269249/how-to-access-the-content-created-date-rather-than-the-...
https://stackoverflow.com/questions/61242017/how-to-extract-metadata-from-docx-file-using-python )
You would need a library specific for your file, and as far as im aware, its not something build universally into Alteryx.
Hope this helps,
TheOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @jason79121 ,
of course it can be done using Python, but I think, a Run Command tool would also help to solve the problem.
My approach would be to call a .bat (or .cmd) file with a dir command.
DIR /T:C returns the creation date, you can limit the files using e.g. DIR /T:C *.xlsx to Excel files. The result can be written to a file using DIR /T:C >outputfile. In my sample dir.bat file I also sort the files by creation date.
The created file can be loaded using Dynamic Input (Block Until Done to ensure, Run Command is executed first).
For each file, the creation date is listed. Unfortunately, a bit of parsing will be needed ...
What do you think?
Best,
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi TheOC, do you happen to have an example workflow of what this might look like in Alteryx once the python output is completed?
I will have to do some learning on python as I am not familiar, but having the Alteryx piece ready would be helpful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @jason79121
All i had in mind was the same as @RolandSchubert . Props for the Run Command tool usage too. I wasn't certain if you would be able to do it that way, knew for certain Python could though.
Cheers,
TheOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It seems like my company restricts the usage of running a .bat file, so I will be trying to figure out how to run and input Python into my Alteryx Workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Unfortunately my IT team restricts the running of .bat files on our laptops, so I will be trying to input Python via alteryx into the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Roland,
I spoke with my Infosec team and got them to approve me running a .cmd file. I had a few questions in your explanation.
1. in your dir.bat file, what is the data\list\files? Are these the directory of the files that are being stored in?
2. In looking at the dynamic input in the example you provided, I see that the "Field" is set to "Dir", is this supposed to corresponded with the dir.bat command?
I apologize if these are basic questions, I am still new to Alteryx and also in general writing commands.
Best,
Jason
