How to join data from all documents in the batch and export them all at once?

Question

How to join data from documents in the batch and export them all at once?

Answer

The best place to do it would be a batch processing custom stage in the Advanced Workflow by adding it before or after the Export stage. On creating a new stage select Automatic type:



Since the whole batch is required at this stage, make sure that Wait for all documents of a batch option is enabled:


The type should be Batch processing:


This is just some sample script that demonstrates how to iterate through each document in a batch and get the values of the fields or document definition name matched on a document:

​​​for (int i = 0; i < Documents.Count; i++)
{
    //getting Document Definition Name matched on a document
    string docdefName = Documents[i].DocumentDefinition.Name;

    //checking first that the document has the field 
    if (Documents[i].HasField("Section name\\FieldName"))
    {

        string fieldText = Documents[i].Field("Section name\\FieldName").Text;

        //for debugging purposes you can use Processing messages/errors. They will be written in the task log in the Processing Server Monitor
        Processing.ReportMessage("fieldText: " + fieldText)

    }

}

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.