Page 1 of 1

Send mail (HTML) containing list of files from a Switch job

Posted: Mon Nov 21, 2022 2:28 pm
by magnussandstrom
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?

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Tue Nov 22, 2022 8:50 am
by freddyp
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.

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Tue Nov 22, 2022 9:39 am
by magnussandstrom
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! :D

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Wed Nov 23, 2022 10:11 am
by freddyp
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).

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Wed Nov 23, 2022 8:10 pm
by magnussandstrom
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?
xmlerror.png
xmlerror.png (156.57 KiB) Viewed 1880 times

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Wed Nov 23, 2022 10:43 pm
by freddyp
What version of Folder apps are you using? And what are the exact values of the properties?

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Thu Nov 24, 2022 1:48 pm
by magnussandstrom
freddyp wrote: Wed Nov 23, 2022 10:43 pm What version of Folder apps are you using? And what are the exact values of the properties?
Folderapps 4.0
5BF344AB-9972-4D46-8851-646E20F36C4F.jpeg
5BF344AB-9972-4D46-8851-646E20F36C4F.jpeg (126.15 KiB) Viewed 1845 times

Re: Send mail (HTML) containing list of files from a Switch job

Posted: Fri Nov 25, 2022 11:05 am
by magnussandstrom
I again, when I changed fileformat from .pm5 to .ps the XML works!