Extractor Constraints

Automatically validate the extracted data using constraints

The Extractor Constraints feature in Robot Studio allows you to automatically validate the extracted data using constraints. By applying specific constraints, you can ensure the accuracy and reliability of the extracted data. To utilize this feature effectively, it is important to understand the concept of creating human tasks for validation.

Overview

Extractor constraints assist the user in auto-validating the extracted data. This validation process occurs within the Task window. To initiate the validation, you need to create a Task with the ExtractionResult. Detailed information on creating human tasks can be found in the "Creating Human Tasks" section.

The validation using constraints takes place when the user changes the Task status to 'Done'. At this point, the specified constraints are applied to the extracted data for validation. If the data does not satisfy the constraints, the user is notified, and the task will not be saved. The type of constraints applied to a field depends on its field type. There are six types of constraints available: Text Constraints, Symbol Constraints, Number Constraints, Date Constraints, List Constraints, and General Constraints.

Creating Human Tasks

To utilize the Constraints feature effectively, it is important to create human tasks for validating the extracted data. The process of creating human tasks involves defining the validation requirements and configuring the tasks accordingly. This documentation primarily focuses on the Extractor Constraints feature, but you can refer to the relevant Robot Studio documentation for detailed instructions on creating human tasks.

Configuring Constraints

The Create Document Extractor Window allows you to specify the constraints for each field. Here's how you can configure the constraints:

  1. Locate the field for which you want to set constraints.

  2. Under the options dropdown for the field, you will find the constraints applicable to the field type. Only the relevant constraints for the field type will be displayed.

  3. Select the desired constraint(s) for the field from the dropdown menu. For example, if the field is of type Text, you may choose Text Constraints like Lower Case, Upper Case, Patterns, or Max. Characters.

  4. If you want the constraint to be enforced, make sure to select the Enforce Constraints option. This ensures that the specified constraints will be applied during validation.

  5. Repeat the above steps for other fields as needed, configuring constraints based on their respective types.

By specifying the constraints for each field and enabling the Enforce Constraints option, you can ensure that the extracted data is validated according to the defined rules. This helps in maintaining data integrity and accuracy during the automation process.

Text Constraints

Text constraints are applicable to fields of the Text type. These constraints ensure that the data meets specific requirements for text fields. The following constraints are available under Text Constraints:

Lower Case

This constraint allows only lower case characters in the extracted data. Any uppercase characters will be considered invalid.

Upper Case

This constraint allows only upper case characters in the extracted data. Any lowercase characters will be considered invalid.

Patterns

The Patterns constraint enforces that the extracted data should fully match a specified regular expression (regex) pattern. The regex engine used for pattern matching is PCRE (Perl Compatible Regular Expressions).

Max. Characters

The Max. Characters constraint ensures that the total number of characters in the extracted data does not exceed the specified limit. If the extracted data exceeds the defined limit, it will be considered invalid.

Number Constraints

Number constraints are applied to fields of the Number and Currency types. These constraints validate the extracted numerical data. The following constraints are available under Number Constraints:

Max Digits

This constraint specifies the maximum number of digits allowed in the extracted number. If the extracted number exceeds the defined limit, it will be considered invalid.

Min Digits

The Min Digits constraint specifies the minimum number of digits required in the extracted number. If the extracted number does not meet the minimum digit requirement, it will be considered invalid.

Allow Decimal Notation

This constraint allows the extracted number to have decimal notation (e.g., 12.34). If this constraint is not enabled, only whole numbers will be considered valid.

Max Places

The Max Places constraint defines the maximum number of decimal places allowed in the extracted number. If the extracted number exceeds the specified decimal place limit, it will be considered invalid.

Min Places

This constraint specifies the minimum number of decimal places required in the extracted number. If the extracted number does not meet the minimum decimal place requirement, it will be considered invalid.

The Max Places and Min Places Constraints are enabled only if Allow Decimal notation constraint is applied.

Limit Decimal Separator

The Limit Decimal Separator constraint ensures that the extracted number uses a specific decimal separator character (e.g., period "." or comma ","). If the extracted number uses a different decimal separator, it will be considered invalid.

Allow Symbols

This constraint allows only the specified symbols in the extracted number. If this constraint is not enabled, the presence of symbols in the extracted number will be considered valid.

Date Constraints

Date constraints are applicable to fields of the Date and DateTime types. These constraints validate the extracted date values. The following constraint is available under Date Constraints:

Format

The Format constraint specifies the required format for the extracted date. The extracted date must match the specified format; otherwise, it will be considered invalid.

List Constraints

List constraints are applied to fields of the Select and MultiSelect types. These constraints validate the extracted data against a predefined list of values. The following constraint is available under List Constraints:

Restrict Other Values

The Restrict Other Values constraint ensures that the extracted data belongs to the predefined list of values. If the extracted data does not match any of the predefined values, it will be considered invalid.

Symbol Constraints

Symbol constraints are applicable to fields of the Text type. These constraints validate the extracted data based on specific symbol requirements. The following constraints are available under Symbol Constraints:

Alpha

The Alpha constraint allows only alphabetic characters (A to Z) in the extracted data. Any non-alphabetic characters will be considered invalid.

Numeric

The Numeric constraint allows only numeric characters (0 to 9) in the extracted data. Any non-numeric characters will be considered invalid.

Custom Characters

The Custom Characters constraint restricts the extracted data to specific characters. If you want to allow only certain characters, you can define them as custom characters. For example, if you want to allow only the characters "$" and "%," you should specify "$%" as the custom characters. Any characters other than the specified custom characters will be considered invalid.

If both Alpha and Numeric is selected, then both alphabets and numbers can be contained in the text. If Custom Characters are also specified, then that characters will also be allowed.

General Constraints

General constraints are applicable to all type of fields. It includes only the "Check Expression" constraint.

Check Expression

This constraint allows you to validate the extracted data using a Boolean expression. You can use the names of fields as variables in the expression to perform specific validations. Here is an example:

InvoiceNumber.Length < 12

In this example, the expression checks whether the data in the InvoiceNumber field has a total character count less than 12. If the expression evaluates to true, the data is considered valid. If the expression evaluates to false, the data is considered invalid.

You can create custom Boolean expressions using operators such as comparison operators (<, >, <=, >=, ==, !=), logical operators (&&, ||, !), and arithmetic operators (+, -, *, /). The variables in the expression refer to the fields in the extracted data.

By utilizing the Check Expression constraint, you can define complex validation rules based on your specific requirements and ensure the accuracy and integrity of the extracted data.

By understanding and utilizing the available constraints effectively, you can ensure the accuracy and integrity of your extracted data.

Last updated