Scripts validation

Vaidation scripts in Kofax Capture can be used in a huge number of ways – from a simple field cleanup, to interactive database lookups and calling out to external code libraries. You can check the values and confidence levels returned from recognition and make decisions based on these. You can skip documents in validation if fields are populated or have high confidence levels for example.

You can also allow interaction with users, through something as simple as a message box, through to calling out to external applications and passing data to and from Kofax Capture.

The guide below is intended to show how to use validation scripts within Kofax Capture.

You can use this as a starting point, and can also use some of the free code samples provided to add some basic functionality to your scripts.

Feel free to use the Contact section to get in touch if you have any questions, or more involved scripting requirements.

Validation Scripts can make a huge difference to your Capture system's productivity, and can offer interaction with Validation users.

How to Create Validation Scripts

Create a Validation script by right-clicking on a document class and selecting Document Validation Script.

Select VB.NET as Scripting Language and Create.

NB. It is best to define all your Index Fields first, and create the script afterwards, as a template will be created with all the relevant fields included. If you later add/rename an Index Field used in the script, you will need to manually edit the script to include or remove new or deleted fields.

A template script will be created with each defined Index Field included:

You can create code for each Index Field and add script to this directly, and you can also add any required script functions into the template as shown below.

These can then be called from anywhere else in the validation script.

Select the Index Field you want to use the function against from the top left drop down, and FieldPostProcessing from the top right drop down.

Add the following line to the function which is created for that Index Field:

NB. The above is for an Index Field called Customer_Reference and a function called RemoveMultipleSpaces. Replace these with the actual Index Field name, and function required.

Save the project, and select Build > Rebuild Solution from the menu bar.

Close the editor.

Re-publish the batch class and test the script by processing a batch through to validation. In the above example any multiple spaces would be removed and only single spaces would be left. So the original OCR/ICR value ‘123 High Street London’ would be replaced with ‘123 High Street London’ as the field is exited in validation.

It is possible to use more than one script for the same Index Field in this way. For example if you use the RemoveMultipleSpaces script, and also the UpperCase script, you could call them both by adding the following to the FieldPostProcessing function: