Folder Creation

Automatic folder creation (auto-foldering) is a process by which the folders in a batch are created or populated based on document index field values.

Although you can manually create a folder hierarchy through various batch editing functions, this may be time-consuming, and the results may not be consistently or correctly applied. To address this, Kofax Capture can automatically create and populate folders when a batch is closed at certain points in the workflow. You can also invoke auto-foldering at any time in the workflow by selecting an option in the Batch menu in the interactive modules (Validation, Verification, Scan, and Quality Control).

In the Administration module, you identify which folder classes to use in a batch. You do not actually create any folders.

Folder creation rules define the organization for folders that are created and populated automatically. You can think of them as a "default" folder hierarchy, although the hierarchy does not actually exist until the batch is processed and the rules executed. The folders are created in accordance with the rules as a batch is processed through the workflow. You can create any type of folder structure; however, you are limited to the folder classes associated with the batch class, and you can have no more than 32,000 nested levels of folders.

If an unexpected error should occur during folder creation, in most cases the entire creation operation is rolled back. No new folders are created and no documents are placed in them. For certain types of errors, you may end up with the folder hierarchy partially created and partially populated with documents.

Basic Auto-foldering Process

During automatic folder creation, a document's index field values are compared to existing folder index field values. If the appropriate rules are satisfied, then the document is placed in a matching folder.

Otherwise, a new folder is created, its folder index field values are copied from the document index field values, and the folder is added to the folder hierarchy. The document is then added to that newly created folder. This only affects documents that are not already in a folder.

Index Fields

Any document index field value (if it is not in a table) may be used to drive automatic folder creation. Hidden index fields may also be used. This may be useful if a field is automatically recognized and used to drive folder creation, but should not be visible to the validation operator.

Note that index fields can be filled in through a variety of techniques including bar codes, patch codes, OCR/ICR, scripting, and customizations. Appropriate index field values must be provided before they can be used to create a folder.

Folder Creation Rules

Automatic folder creation is driven by a series of rules that are defined as part of the batch class. A particular folder creation rule defines how document index fields can be used to identify an existing folder or create a new folder, and then place the document into that folder.

Rules are defined on the Foldering tab on either the Create Batch Class window or the Batch Class Properties window.

The document class index field is identified by selecting a document class, and associated index field. Only document classes attached to the batch class can be used.

Next, it is necessary to select a corresponding folder class and folder class index field. Only folder classes attached to the batch class can be used. For auto-foldering to function properly, the field type of the document class index field and the associated folder class index field must match.

The next step is to define a nesting level for the folder. The level parameter identifies the depth within the folder hierarchy that the rule is to be applied. If folders are never nested in other folders, then a depth of 1 is used (for example, folders situated directly off the batch). For more than one level of nesting, rules associated with a greater depth are necessary.

The final step is to identify the actual rule behavior. Two choices are available:

  1. Create When Value is Unique

    There are several choices for creating folders when the value is unique. The default value is unique (null as error) if this is the first time you are assigning a rule to an index field in a particular document class. Otherwise, the default value is the already assigned rule. In other words, the creation rules must be the same among all index fields in the same document class.

    When using this method, the selected document index field value is checked against the corresponding folder index field value in already existing folders of the specified folder class. With this method, there is no need to manually sort your documents before scanning them. Documents with the same index field value can be scanned in any order, and auto-foldering places them all in the same folder.

    If a match is found, then the document is placed in the folder and becomes the last document in that folder. If more than one folder matches, then the last matching folder (the one at the end of the hierarchy in the batch ordering) is used. All matching uses a case-insensitive string comparison. For example, cat and CaT are treated as a match. Note that 01 and 1 do not match since a string comparison (rather than numeric) is used, irrespective of the field type.

    If a matching folder is not found, then a new folder is created. In this case, the folder class is the one specified in the folder creation rule. After the new folder is created, the document is moved into that folder.

    Once a folder has been created, the folder index field is set to the value of the corresponding document index field. The confidence of the folder index field is set to the same value as that of the document index field. At this point, the values of all other folder index fields are blank, and their confidence values are zero. Blank folder index fields may not appear blank during validation if the Validation module applies a default value.

    Use this method to organize your documents into logical folder groups within Kofax Capture. In order for your export connector and document management software to make use of this structure, you need to configure the Kofax Capture foldering rules so that the resulting folder hierarchy can be recognized by them. For example, the folder name property in an export connector should typically be set to equal the value of the corresponding folder index field in Kofax Capture.

    There are three variations on this method of auto-foldering.

    • unique (null as value): If you select this method, a blank document index field creates an unnamed folder and places the document in that folder. All the documents with blank index fields end up in the same folder.

    • unique (null as wildcard character): If you select this method, a blank document index field matches any existing folders with the appropriate folder class, irrespective of the value. If there is more than one matching folder, then the last one is used.

    • unique (null as error): If you select this method, a blank document index field results in an error, and puts the batch into an error state.
  2. Create When Value is Not Null

    This method (also referred to as not blank) is best used in cases in which the sequence of documents is used to determine folder grouping, instead of the unique value of an index field.

    With this method, if the document index field value is blank, then the document is moved to the most recently created folder. If no folder has been created by this algorithm, but a folder already exists, then the last existing folder is used, regardless of the folder class. If the document index field value is not blank, then a new folder is created, whether or not the index field value matches that of an existing folder.

    The key concept with this method is that a folder is created when any non-blank value is recognized, even if it is the same value repeatedly. You may find this useful in cases in which special documents are inserted in the batch to flag the beginning of a new folder. For instance, a particular document may have a patch code that always indicates the creation of a new folder. It is the sequence of these documents, not the value, that identifies the folder grouping.

    However, if no folders exist, and a document with a blank index field is processed, the document is rejected with the following note:

    Automatic Folder Creation Error - Creation by Sequence rule requires a non-null value or existing folder.

    Automatic folder creation stops at this point, and no further documents are processed. Prior folder creation results are retained. This method assumes you have already organized your documents into logical folder groups outside Kofax Capture.

Folder Creation Scenarios

Scenario 1: Single Level Folders by Social Security Number

Imagine you want to collect the performance reviews of multiple employees into folders for each employee, based on the social security number. Each time the social security number changes, a new folder is created. Assume that the batch class contains a single folder class called Employee Records with a folder index field called SSN (Social Security Number).

Assume that the batch class also contains a single document class called Annual Review with a document index field called SSN. In this example, you intend to put a bar code on every annual review with the social security number, and have that value placed into the document index field SSN.

To implement this example, first configure Kofax Capture to automatically read this data and place it into an index field.

You also decide to put a generic patch code on each document to allow document separation.

Next, enable folder creation, and set up a single folder creation rule, similar to the following example.

Figure 1. Single Folder Creation Rule

After publishing the batch class, scan a batch that contains documents from various employees in no particular order. For each unique SSN, a folder is created. This folder contains all documents with a matching SSN.

Scenario 2 - Single Level Folders by Patch Code

In this case, you want to identify all documents associated with a particular insurance claim where the claim number serves as the folder key, yet it is not assigned until later in the workflow. Assume that the batch class contains a single folder class called Insurance Claim with a folder index field called Claim Number. Also, the folder class includes an additional, hidden index field called Folder Start.

Assume further, that the batch class also contains a single document class called Claim Document with a hidden index field called Folder Start.

Finally, in this example, Folder Start is filled at scan time with a bar code, and document separation is by patch code.

To implement this example, first configure Kofax Capture to automatically read this data and place it into an index field.

Next, enable folder creation, and set up a single folder creation rule, as shown in the example.

Figure 2. Single Folder Creation Rule

After publishing the batch class, sort the claim documents corresponding to a claim number and place a patch code sticker on each for document separation. Additionally, on the first document of each group (of claim numbers), place a bar code sticker on the front. Note that the bar code is the same for all groups.

Next, scan the batch. When the batch is closed, folders are created around each collection of documents. Each time a document with a bar code is detected, a new folder is generated. Because the other documents in the group do not have a bar code, a blank or null value is returned, meaning that a folder is not created.

Note that the folders do not yet contain the Claim Number index value. The validation operator manually reviews each claim, and enters a claim number into the Claim Number folder index field.

Scenario 3 - Document Classes without Automatic Folder Creation Rules

There may be cases in which you want multiple document classes within a single folder. In such cases, it is likely that only one of those document classes would serve as a trigger for creating the folder.

For instance, a particular form might occur in the batch that indicates that a new folder should be created, and that has a key folder index field for that folder. Subsequent documents of various other document classes should be placed in that folder, but do not contribute any values to that folder, nor do they trigger creation of a new folder.

In this case, set up a folder creation rule for the document class that triggers folder creation; rules are not needed for the other document classes. During automatic folder creation, documents with document classes that do not trigger a new folder are placed in the most recently created folder. If no folder is created by the algorithm, then the last folder is used.

Note that a document with no form type still follows these rules. It has an implied document class of none, which never has an automatic folder creation rule associated with it.

Scenario 4 - Multiple Document Classes per Folder Class

There may be cases in which you want multiple document classes to create multiple folders using the same folder class. In other words, you have several kinds of documents that should all go into the same folder.

The auto-foldering rules might look something like the following example.

Figure 3. Auto-Foldering Rules

Scenario 5 - Multiple Folder Creation Rules per Document Class

It is possible to have multiple folder creation rules that involve the same document class and folder class, but use different index fields.

For instance, assume that a document has two bar codes: one that indicates SSN and one that indicates Name. If you want both the SSN and the Name to be automatically populated in new folders, then two automatic folder creation rules would need to be created, one for each field.

Figure 4. Auto-Foldering Rules

You cannot have two folder creation rules with the same document class, document index field, folder class, and folder index field.

If your folder rules use one of the create by value methods, then if any of the document index fields involved in folder creation don't match, a new folder is created. Keep in mind that a blank field may act as a wildcard character in these cases.

Blank values act as wildcard characters, in that they match any existing folders with the appropriate folder class, irrespective of the value. If there is more than one matching folder, then the last one is used.

If your folder rules use Create when Value is Not Null, then if any of the document index fields involved in folder creation are not blank, a new folder is created.

Multiple Levels

The preceding scenarios have been limited to single-level folder hierarchies. In some cases, you may wish to classify documents based on a multilevel folder hierarchy. Folder creation rules in these cases can become quite complex.

When there are rules involving multiple levels, each level is evaluated independently, with level 1 first, level 2 next, and so forth up to the nesting limit of 32,000 levels. After evaluating the rules for a particular level, the rules for the next level only apply to the sub-hierarchy selected (or created) by the rules at the prior level.

All the rules for a particular level must have the same creation rule. In other words, mixing creation rules within a level is not allowed.

All the rules with the same folder class and document class must be at the same level. This means that they must also have the same creation rule. If there are no rules for a particular level (but there are rules for higher levels), then the system chooses the last existing folder at that level (irrespective of folder class).

If there are no creation rules for the current level, and no folders at that level, the document is rejected with the following note:

Automatic Folder Creation Error - No rules for level <n>, and no existing folder.

Automatic folder creation stops at this point, and no further documents are processed. Prior folder creation results are retained.

Scenario 6 - Multiple Level Folders by Social Security Number, and Document Type

Assume that the Annual Review example is extended, so that multiple kinds of documents are involved. In this case, you want to classify the document first based on SSN, and second, based on document type.

The folder class Employee Records is used from the first scenario. Another folder class called Employee Documents is added to the batch class with a folder index field Document Type. Also, assume that the document class Annual Review is replaced with a more general purpose document class called Employee Document with two index fields: SSN and Document Type.

Document separation is performed by patch code, as in the first example.

A bar code on every document indicates the social security number, which is used to populate the SSN document index field. Additionally, a second bar code indicates the document type.

Configure Kofax Capture to automatically read this data and place it into the Document Type index field. Next, enable folder creation, and set up rules.

Figure 5. Auto-Foldering Rules

When you scan a batch of documents, the batch contains various document types from various employees in no particular order. Under these rules, for each unique SSN, a top-level folder is created. For every unique document type found with that SSN, a subfolder is created.