I would like to send an email to that lists files and folders in a Switch job, like this:
Subject: New Switch job added
Files:
FileA.pdf (5 pages, 210x297 mm) - 565 kb
FileB.zip - 4.5 MB
FolderA (32 files) - 354 MB
FolderB (2 files) - 2 MB
I only want to list the files and folders in the "root", not subfolders. I've been experimenting with [Job.NestedName] but got stucked. Any suggestions how to achieve the above?
Send mail (HTML) containing list of files from a Switch job
- magnussandstrom
- Advanced member
- Posts: 376
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Send mail (HTML) containing list of files from a Switch job
Have a look at the "Filetypes Counter" app from the "Folder apps" bundle. It has powerful features for listing different file types at different subfolder levels and putting all that into an XML dataset. I have not tried it, but I feel confident it is possible to do what you need with that app.
- magnussandstrom
- Advanced member
- Posts: 376
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Send mail (HTML) containing list of files from a Switch job
Tnx Freddy, I tried 'Filetyps Counter' but did not get what I need. Now I'm trying to do this with 'Create file from template' app, wish me good luck!
Re: Send mail (HTML) containing list of files from a Switch job
I got it to work. Here is the setup.
"Filetypes counter" with "Root level only" and "File types" defined as as a file type you never receive. The reason for choosing a file type you never receive is because "Filetypes counter" will list all the other file types in the XML under the node "/filetypes/others".
In the Metadata you choose TextIndexed, in "Build location path" you choose "XPath expression" and the XPath is /filetypes/others/item/name. You can then combine them using "Prefix - Suffix" (<li> and </li> if you want to have the files as list items in a mail template).
"Filetypes counter" with "Root level only" and "File types" defined as as a file type you never receive. The reason for choosing a file type you never receive is because "Filetypes counter" will list all the other file types in the XML under the node "/filetypes/others".
In the Metadata you choose TextIndexed, in "Build location path" you choose "XPath expression" and the XPath is /filetypes/others/item/name. You can then combine them using "Prefix - Suffix" (<li> and </li> if you want to have the files as list items in a mail template).
- magnussandstrom
- Advanced member
- Posts: 376
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Send mail (HTML) containing list of files from a Switch job
Thanks for the detailed explanation Freddy! Unfortunatly I cannot load the dataset, I get this error. I have tried with many different Switch jobs/files. If I choose JSON I can load the dataset. Any ideas?
Re: Send mail (HTML) containing list of files from a Switch job
What version of Folder apps are you using? And what are the exact values of the properties?
- magnussandstrom
- Advanced member
- Posts: 376
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
- magnussandstrom
- Advanced member
- Posts: 376
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Send mail (HTML) containing list of files from a Switch job
I again, when I changed fileformat from .pm5 to .ps the XML works!