Merge Documents using MetaData Level Creation

Hi,

I have a simple workflow as a POC which takes in a PDF with multiple pages and I need to merge documents together that have the same address. So in the data mapper I extract the address and add to the metadata in a field called “Address”. I then have a metadata sorter by address and then a Level creation. However that isn’t re-grouping the documents, below is a screenshot of the setup for this, can anyone see why this wouldn’t be working?

When you look at the metadata after the Metadata Sorter step, is it properly sorted?

Yeah it’s sorted correct, has 4 documents in with the first 3 with the same address

First, I wouldn’t use the Execute Data Mapping to generate the metadata you need to re-organize your PDF. It could work properly but I never tried it this way. Here is what I suggest:

  1. Create Metadata plugin where the Documents is None
  2. Metadata Level Creation plugin. Document->Begin when the rule you use to separate each documents of you PDF (address or invoice number, etc…)
  3. Metadata Field Management plugin.
    1. Action = Add
    2. Field Information
      1. Level = Document
      2. Field name = Address
      3. Field value = <your address from the PDF>
    3. Rule = <same rule as at the Metadata Level Creation>
  4. Metadata Sorter, same setting as you currently have
  5. Metadata Sequencer and your rule would be on change on the field Address. This will act as a splitter based on the rule defined in it.

Then you will need use the Create PDF plugin to create all separated PDF.

Let me know if that works.

Hi

I need to do the merging after the data mapper though as I firstly need to report on the number of records received and assign some matching data that comes in a XML index file. Once these have been merged in the data mapper I then create a report on counts etc, then I want to merge packs that are the same address and then pass to a template to add production marks etc

Then you don’t need to sort the data in the metadata after the datamapper. You simply need to do it in the Job Preset. Then separate the document in the Output Preset.

Hi

I’ve created a job config with grouping and then setup a output preset with split in and names the the file “GetMeta(_vger_fld_ID[0], 10, Job.Group[0].Document[0]).pdf”, but what I get is a single PDF which is actually a TXT file with the below in.

C:\Users\servicepres\Connect\filestore\5116.3322432961454518590\template_0001.pdf,C:\Users\servicepres\Connect\filestore\5116.3322432961454518590\template_0002.pdf

But the output should be split into 2 file so not sure what’s going on here as the TXT file does have 2 files listed in it?

James

In Workflow, you have to select, in the Create Output plugin, As defined by Output Preset. In your Output Preset, you tell it where to output the files.
You used Through Workflow, which in case of multiple files, will give you what you have, which is the temporary output folder of your resulting PDF.

Hi

Done that and now got what appears to be the original XML file? I’m trying to use a value from the metadata called ID so I have put the below in for the filename but I’m only getting 1 file?

GetMeta(_vger_fld_ID[0], 10, Job.Group[0].Document[0]).pdf

Do I need to put in some sort of wildcard in the Document[0] to specify the current record

If you receive the original file its because it errored out along the way and the current file in the pipe is still your input file.

Look at your log to figure out where the error occurs.

Yeah there’s no errors in the logs that I can see, will keep trying

If there is no error, then it could be that there is no resulting file from your Template. Do you have any conditions either in your Datamapper or Template that would prevent a PDF generation?

Just been doing some testing and I’ve taken a output config that works fine and I just ticked the “separation” and selected new file every document. As soon as I do that i either get a txt file with 2 files listed if I don’t tick “As defined by Output Preset”, if I tick that then I get my original XML? Below is a screenshot of the config

To help you properly we would need to see the Template and reproduce the issue. I suggest you open a technical support ticket through our website.

Thanks will do

Regards

James

Your output preset says “Output to: Prompt for File”. That means Connect does not know where to output the result and how to name it. So you can not use “As defined by Output Preset”.
Connect output seperation in a workflow only works properly with defined output location and name in the output presets.