Page 1 of 1

Attach metadata from multiple files to e-mail

Posted: Sat Apr 14, 2018 1:51 pm
by LasseThid
I need to extract a metadata/private data key from one or more files and attach that info to an e-mail.

I was thinking I can use Condition with variables defined ([Job.IsFolder] = True) to check whether or not a folder or a single file was submitted to the flow. If it's a folder I can then set [Job.FileCount] as a Private Data key to track how many files were submitted.
I could then add a Hold job with the release condition [Job.FileCount] equals the private data key to make sure I have all files belonging to the job in the hold folder before I release them to the next folder, but how can I add the metadata/private data key I need to a text file that I can then use as the body text for an email?

Thanks in advance
Lasse

Re: Attach metadata from multiple files to e-mail

Posted: Sat Apr 14, 2018 5:19 pm
by jan_suhr
Hi Lasse,


Try my app "Take Notes" it will let you use metadata as Datasets or XML files and store it. Then you add one more "Take Notes" who will pick up some other metadata and you can then add that to the metadata you picked up in the previous one. By building a chain of Take Notes you can add as much metadata you want. It can add to an existing dataset or create new ones for each pickup.

Re: Attach metadata from multiple files to e-mail

Posted: Mon Apr 16, 2018 10:55 am
by Padawan
Starting from version 18 of Switch you can also add private data to jobs via the "Set Job Private Data" property which is added to intermediate folders.

If the issue is the retrieving of the Private Data, you can use Switch variables in mail templates. So adding the [Job.PrivateData:Key="MyPrivateDataKey"] variable to the mail template should do the trick.

Re: Attach metadata from multiple files to e-mail

Posted: Mon Apr 16, 2018 12:13 pm
by LasseThid
I have x files coming into a flow and I need to pick up the same metadata from each file and send all of the metadata in one mail instead of sending x mails. (x ranging from 1 to infinity... :lol: )

Re: Attach metadata from multiple files to e-mail

Posted: Tue Apr 17, 2018 12:01 pm
by Padawan
If you want metadata from all jobs and the metadata is on a different place, then you can assemble the files with Merge Metadata set to Yes and you will have everything.

You mention that it is the same metadata, so Merge Metadata will overwrite some and only keep the metadata of one input file. But is it possible to use different identifiers in the incoming meatadata so they won't overwrite when you merge metadata with Assemble Job?

If that is not possible, then I think you will need a custom script element. It will need to be able to Assemble Jobs, but before Assembling the job gather all the metadata which needs to be gathered from the incoming file and restructure it so the outgoing job folder has all the metadata.