How to get the list of the batch attachments' names programmatically?

Question

How to get the list of the batch attachments' names programmatically?

 

Answer

The automatic (script) stage can be used in the workflow after the Recognition stage for this purpose.

In the below example, the attachments' names will be appended to the same batch registration parameter.

  1. Create an automatic workflow stage:

  2. Navigate to edit the created stage, and set the script type to Batch processing:

  3. Use the code snippet below to write all batch attachments' names into a batch registration parameter:
//C# example
var parameter = "";

var names = Batch.Attachments.Names;

for(int i = 0; i < names.Count; i++)
{
//adjust the parameter formatting
parameter += names[i] + " + ";
}

Batch.Properties.Set("my_parameter", parameter);

 
Here's the result with the above script.
 

 

Additional information

IBatch
IUserAttachments

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.