How to add the original file name to the batch name?

Question

How can I add the original file name to the batch name? We ingest a single file per a batch.

 

Answer

  • In the Advanced Workflow create a script stage after the Scanning stage. It needs to be Automatic type:

 

  • Name it and tick on Wait for all documents of a batch option:

 

  • Switch to Batch Processing type script:

 

  • Here is a sample code:
if (Batch.Documents.Count > 0)
{
    string batchName = Batch.Name;
    string fileName = "";
    
    fileName =  Batch.Documents[0].Pages[0].ImageSourceFileSubPath;
    Processing.ReportMessage(fileName);
    Batch.Name = batchName + " " + fileName;
}

 

  • The result is:

 
Please note, the batch needs to go through the workflow (i.e. imported from the hot folder or sent from Scanning Station).

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.