I need to know who last modified the Excel files in a directory (i.e. the last saved by person when right clicking a file and going to properties).
It doesn't seem to be one of the directory tool fields.
I tried the workflow here: How to get the last modified person name of excel ... - Alteryx Community
This sort of worked except it shows who last did anything at all to the file (including saving it down from an email into a folder, moving to another folder, renaming, etc.). This is different to the last saved by property which is focused on who actually changed any of the contents in the file.
Any suggestions would be much appreciated.
Solved! Go to Solution.
hi @ALT_2358
All excel files are just renamed zip files. If the file was actually modified in Excel, as opposed to a converted Google Sheets file, inside the zip will be the following path .\docProps\core.xml.
The attached workflow opens the xlsx file as a Zip file with the additional specifier to read the xml file in this path and extract the outerXML.
The Parse XML tool gets the child nodes from the main element giving you the last modifier in the cp:lastModifiedBy field
Replace the file in the input tool with the file that you're looking to read. As with all excel operation, the workflow will error if the file is open.
Dan
That's amazing, it works! Thank you so much!
Do you know if it's possible to convert it to a dynamic input? I tried by changing the entire path but I get an error saying no file specified in zip archive.
If it's a normal input every time I change the file path it automatically changes to an Excel input and I have to set it up again so it's the same as the zip input you used.
EDIT: Actually, just realised that I needed to add '|||docProps/core.xml' to the path before the dynamic input.
It's working now - thank you!!
Thanks
Hi,
did you also find a solution for getting the names out of multiple files (directory) without "touching" each single file?
Thank you very much!
BR Sebastian
Hi Sebastian,
I did - I used a batch macro. Just place a dynamic input tool within the macro (using the zip setup) - the file path of the dynamic input tool needs to be set using the macro input. You may need to play around with the formula within the action tool to get this to work. I’ve moved companies now so I no longer have access to the macro unfortunately but hope that helps nonetheless.
thanks for your reply! Unfortunately I do not have any experience with the macros yet. Could it touch diverse data types (e.g. excel, word, folder, etc.)?
Looking forward to hearing from you!
BR Sebastian
Yep I’ve had it cycle through a list of file paths which included Excel, Word and PowerPoint files. It didn’t work for images if I recall correctly, though.
There are plenty of resources on the community to help you get started with macros. Check out the batch macro examples - that’s how I learnt about them.