The example below explains how to automatically extract data, classify documents, extract the specified fields from the documents, prepare all information for validation, and display the extracted documents. It presents activities such as FlexiCapture Scope, Classify Document, Process Document, Prepare Validation Station Data, and Present Validation Station. You can find these activities in the UiPath.IntelligentOCR.Activities and UiPath.Abbyy.Activities packages.
This is how the automation process can be built:
- Open Studio and create a new Process named by default Main.
- Drag a FlexiCapture Scope activity in the Workflow Designer.
- Select the Do container placed inside the FlexiCapture Scope activity and create the following variables:
Variable Name | Variable Type | Default Value |
---|---|---|
| String | |
| UiPath.Abbyy.Core.FlexiCapture.FCDocument | |
| UiPath.Abbyy.Core.FlexiCapture.FCDocument | |
| UiPath.Abbyy.Core.FlexiCapture.FCDocument | |
| UiPath.Abbyy.Core.FlexiCapture.ValidationStationAdapters.ValidationStationData | |
| UiPath.DocumentProcessing.Contracts.Results.ExtractionResult | |
| System.String[] | |
| UiPath.DocumentProcessing.Contracts.Results.TableFieldValue[][][] |
- Drag an Assign activity inside the Do container.
- Add the variable
FolderValues
in the To field and the expressionDirectory.GetFiles("Input")
in the Value field.
- Add the variable
- Drag a For Each activity below the Assign activity.
- Add the value
item
in the ForEach field. - In the Properties panel, select the
String
option from the TypeArgument drop-down list. - Add the variable
FolderValues
in the Values field.
- Add the value
- Select the Body container inside the For Each activity and create the following variable:
Variable Name | Variable Type | Default Value |
---|---|---|
| String |
- Drag a Classify Document activity inside the Body container.
- In the Properties panel, add the expression
{Directory.GetCurrentDirectory + "\Invoice.fcdot", Directory.GetCurrentDirectory + "\Letters.fcdot" }
in the DefinitionFiles field. - Add the expression
item.ToString
in the SourceDocument field. - Add the variable
ClassificationResult
in the Result field.
- In the Properties panel, add the expression
- Drag a Message Box activity under the Classify Document activity.
- In the Properties panel, select the option
Ok
from the Buttons drop-down list. - Add the expression
"Document type is: " + ClassificationResult
in the Text field. - Select the check-box for the TopMost option. Doing so, the message box is always displayed to the foreground.
- In the Properties panel, select the option
- Drag a Process Document activity under the Message Box activity.
- In the Properties panel, add the expression
{Directory.GetCurrentDirectory + "\Invoice.fcdot", Directory.GetCurrentDirectory + "\Letters.fcdot" }
in the DefinitionFiles field. - Add the value
item.ToString
in the Document field. - Add the variable
processedDoc
in the Result field.
- In the Properties panel, add the expression
- Drag a Prepare Validation Station Data activity below the Process Document activity.
- In the Properties panel, add the variable
processedDoc
in the Document field. - Add the variable
ValidationData
in the ValidationStationData field.
- Drag a Message Box activity under the Prepare Validation Station Data activity.
- In the Properties panel, select the option
Ok
from the Buttons drop-down list. - Add the expression
"Document was processed with confidence score: " + processedDoc.Confidence.ToString
in the Text field. - Select the check-box for the TopMost option. Doing so, the message box is always displayed to the foreground.
- Drag a Present Validation Station activity and place it under the Message Box activity.
- In the Properties panel, add the expression
ValidationData.ExtractionResults
in the AutomaticExtractionResults field. - Add the expression
ValidationData.Dom
in the DocumentObjectModel field. - Add the value
item
in the DocumentPath field. - Add the expression
ValidationData.RawText
in the DocumentText field. - Add the expression
ValidationData.Taxonomy
in the Taxonomy field. - Add the variable
HumanValidated
in the ValidatedExtractionResults field.
- Drag a For Each activity below the Present Validation Station activity.
- Add the value
item
in the ForEach field. - In the Properties panel, select the option
UiPath.UiPath.DocumentProcessing.Contracts.Results.ResultsDataPoint
from the TypeArgument drop-down list. - Add the expression
HumanValidated.ResultsDocument.Fields
in the Values field.
- Place a Log Message activity inside the Body container of the For Each activity.
- Select the option
Info
from the Level drop-down list. - Add the expression
item.FieldName
in the Message field.
- Place another Log Message activity below the first Log Message activity.
- Select the option
Info
from the Level drop-down list. - Add the expression
item.Values(0).Value.ToString
in the Message field.
- Drag a Write Line activity under the Log Message activities.
- Add the value
""
in the Text field. - This is how the For Each activity should look:


- Drag an Assign activity below the For Each activity.
- Add the variable
TableValues
in the To field. - Add the expression
HumanValidated.GetTableFieldValue("CustomGroup.CustomCategory.Invoice.InvoiceTable")
in the Value field.
- Drag a For Each activity and place it below the Assign activity.
- Add the value
row
in the ForEach field. - In the Properties panel, select the option
UiPath.DocumentProcessing.Contracts.Results.TableFieldValue[]
from the TypeArgument field. - Add the variable
TableValues
in the Values field.
- Place a For Each activity inside the Body of the previously added For Each activity.
- Add the value
item
in the ForEach field. - In the Properties panel, select the option
UiPath.DocumentProcessing.Contracts.Results.TableFieldValue
from the TypeArgument field. - Add the value
row
in the Values field.
- Drag a Log Message activity in the Body container of the last For Each activity.
- Select the option
Info
from the Level drop-down list. - Add the expression
item.RawValue
in the Message field. - This is how the For Each activity should look:


- Run the process. The robot extracts data automatically, classifies the documents, extracts specific field, prepares the data for validation, and displays the extracted documents.
Updated 6 months ago