Activities
latest
false
Banner background image
Document Understanding Activities
Last updated Apr 10, 2024

FlexiCapture Integration

The example below explains how to create an automatic data extraction that classifies the documents, extracts specific fields, and validates them. The output is visible in a newly created .xlsx file. It presents activities such as Classify Document, Validate Document, Get Field, Export Document, or Get Table. You can find these activities in the UiPath.Abbyy.Activities package.

This is how the automation process can be built:

  1. Open Studio and create a new Process named by default Main.

    Note: Make sure to add all the needed files (.json files and all the images) inside the project folder.
  2. Drag a Sequence container in the Workflow Designer.
  3. Drag an FlexiCapture Scope activity inside the Sequence container.
  4. Select the Do container inside the FlexiCapture Scope activity and create the following variables:

    Variable Name

    Variable Type

    Default Value

    classification

    String

     

    processedDoc

    UiPath.Abbyy.Core.FlexiCapture.FCDocument

     

    validatedDoc

    UiPath.Abbyy.Core.FlexiCapture.FCDocument

     

    field

    UiPath.Abbyy.Core.FlexiCapture.FCField

     

    ValidationData

    UiPath.Abbyy.Core.FlexiCapture.ValidationStationAdapters.ValidationStationData

     

    HumanValidated

    UiPath.DocumentProcessing.Contracts.Results.ExtractionResult

     

    FolderValues

    System.String[]

     

    TableValues

    UIPath.DocumentProcessing.Contracts.Results.TableFieldValue[][]

     
  5. Drag an Assign activity inside the Do container.

    • Add the variable FolderValues in the To field.
    • Add the expression Directory.GetFiles("Input") in the Value folder.
  6. Add a For Each activity below the Assign activity.

    • In the Properties panel, select the option String from the TypeArgument drop-down list.
    • Add the variable FolderValues in the Values field.
  7. Select the Body container placed inside the For Each activity and create the following variables:

    Variable Name

    Variable Type

    Default Value

    ClassificationResult

    String

     

    InvoiceNumberField

    UiPath.Abbyy.Core.FlexiCapture.FCField

     

    InvoiceTableField

    System.Data.DataTable

     

    InvoiceTableText

    String

     
  8. Drag a Classify Document activity in the Body of the For Each activity.

    • 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.
  9. Drag a Message Box activity below 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.
  10. Drag a Process Document activity below 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 expression item.ToString in the Document field.
    • Add the variable processedDoc in the Result field.
  11. Drag a Message Box activity below the Process Document 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.
  12. Drag a Validate Document activity under the Message Box activity.

    • In the Properties panel, add the variable processedDoc in the Document field.
    • Add the variable validatedDoc in the Result field.
  13. Drag a Get Field activity under the Validate Document activity.

    • In the Properties panel, add the variable validatedDoc in the Document field.
    • Add the variable "InvoiceNumber" in the Name field.
    • Add the variable InvoiceNumberField in the Result field.
  14. Drag a Message Box activity below the Get Field activity.

    • In the Properties panel, select the option Ok from the Buttons drop-down list.
    • Add the expression InvoiceNumberField.Value in the Text field.
    • Select the check-box for the TopMost option. Doing so, the message box is always displayed to the foreground.
  15. Drag a Get Table activity below the Message Box activity.

    • In the Properties panel, add the variable validatedDoc in the Document field.
    • Add the variable "InvoiceTable" in the Name field.
    • Add the variable InvoiceTableField in the Result field.
  16. Drag an Output Data Table activity under the Get Table activity.

    • In the Properties panel, add the variable InvoiceTableField in the DataTable field.
    • Add the variable InvoiceTableText in the Text field.
  17. Drag a Message Box activity below the Output Data Table activity.

    • In the Properties panel, select the option Ok from the Buttons drop-down list.
    • Add the variable InvoiceTableText in the Text field.
    • Select the check-box for the TopMost option. Doing so, the message box is always displayed to the foreground.
  18. Drag an Export Document activity below the Message Box activity.

    • In the Properties panel, add the variable validatedDoc in the Document field.
    • Select the XLS option from the Format drop-down list.
    • Add the expression "export.xls" in the Name field.
    • Add the expression Directory.GetCurrentDirectory + "\Output" in the Path field.
  19. Run the process. The robot automatically extracts the data and creates a new file with the validated results.

Download example from here.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.