Definition & Execution of Business Rules for Fields (mandatory, possible values & fixed format rules)

In order to paint the full picture of a Document Type, together with information which is not necessarily available in the document itself, we have added the ability to provide additional information :gear: about it. In this effort, I’m happy to report, we started enriching the Document Type with Business Rules, on a Field Level, staring with the Intelligent OCR package version 6.6.0-preview.
These rules need to be respected by the extracted field values, in order for the extraction to be considered successful (e.g. Invoice Number must be of a given form, mandatory fields, Vendor Name can be either “Uber”, “Lyft” or “Bolt”, etc.).

Rule Definition :writing_hand:
In order to define the rules, one would go in the Taxonomy Manager, select the corresponding Document Type & Field, and navigate to the “Business Rules” tab:

One will be able to add multiple rules and define one rule operator type:

  • AND - indicating that all rules need to be fulfilled - if any of the rules is broken, an exception is raised
    • e.g. Invoice Number starts with A AND ends with X
    • valid field value: A123X; invalid field value: A123
  • OR - either of the rules need to be fulfilled - if all rules are broken, an exception is raised
    • e.g. when working with invoices and qualifying these based on Vendors, the Vendor must start with A OR Vendor is BCA, CCC or DEB.
    • valid field value: ABC, AAA, CCC; invalid field value: XYZ

The following rule types will be available:

  1. Is not empty: the extracted value is not empty (may represent a mandatory field) - and if missing, it requires validation/manual input
  2. Possible Values: the extracted data is one of the certain possible values, defined by the user (e.g. Employer Type is either “full-time”, “part-time” or “internship”)
  3. Fixed Format: the extracted data is in a fixed format - starts with, ends with, has X characters, is numeric, is date, is email; in other words, it matches a RegEx (e.g. Invoice Number starts with INV-, Postal Code has 6 characters ) - applicable to text fields only

One is also able to define a criticality level for all rules of the field

  • SHOULD (default)
  • MUST

Rule Execution :robot:
The rules will be executed after the data from the Documents has been extracted. Their result, is available on the Extraction Result as a collection of FieldRuleException, which can be evaluated in the workflow, via the following methods:

  • ExtractionResult#hasExceptions
  • ExtractionResult#hasExceptionsOfType[“X“], where X = field type
  • ExtractionResult#hasExceptionsOfCriticality[“X“], where X = criticality type (SHOULD, MUST)

Rule Validation🕵️
The execution of the rules will also be displayed in the Validation Station (both in Studio and in Action Center), so that Users can easily see and navigate through them.
As a result, the fields grouped into the following categories:

  • fields with broken rules - and after fixing the extracted value and respecting the defined rule, these will be moved to the second group.
  • fields without broken rules (as last group)
    Note that, one is able to submit and save a document with only SHOULD rules broken - however, rules of criticality MUST need to be resolved.

In this first version of the feature, the rules will be re-evaluated when the user attempts to submit a Validation Station session - however, in the future, we plan on improving the experience.

Future :rocket:
The 3 rules are just a start - we plan on adding many more (for example for mathematical operations or connections to third parties) - in this sense, please do give them a try & provide us your feedback! How is their configuration so far? What other rules would you like to see? :pray:


I like the way it’s lined with taxonomy manager. Thank you (Reduce lot of effort for sure). I would prefer to see any option to map the dynamic values using variables with simple and collection data type. For eg:- checking customer list of delivery address retrieved from db match with extracted value.

In addition do we get the output on the validation similar one like extracted results?

@balaraman.ramiya stay tuned, we plan on adding this too! :slight_smile: :dancer: (just a matter of timing)

1 Like

Hey Monica,

This is a great update and makes a step in business rules and validation much easier with this UI experience. Kudos to you and your team for another great release!

I’m currently using studio 2022.4.1 (Enterprise License) & don’t see it as an update for UiPath.intelligentOCR.activities, can I know when we can expect it?

Also would love to see more dynamic business rules such as dynamic regex, adding if fields are mandatory or not & respective confidence thresholds to start since these validations are prominently used in many automations.

Looking forward to test this out soon!

1 Like

Hello @sharon.palawandram :slight_smile:

Next to the search box you have a filter icon and from what I notice the “Include Prerelease” is not selected for you. Once you tick that filter you should be able to see and use our preview packages

1 Like

Awesome, thank you @Anca_Bolca, excited to try this!

Hello @Monica_Secelean, I am trying out the new Intelligent OCR package version 6.6.0, the action center/validation station looks great as it only shows fields that would need validation.

However, when I don’t use validation, some fields have 2 extracted results for one field value, one extraction with 100% accuracy & the other with lower accuracy ( shows as a suggested value). In extraction result both get extracted for one field value & shows in two rows in the extraction result. How do I avoid this?

Thank you.

@sharon.palawandram I don’t think I fully understand your issue: what is it you’re trying to do? This is the expected result after extraction, when there are suggested values.

This is one of the fields I am extracting, here the [2] mentioned are two suggestions for the field.

However, if I don’t validate it, both suggestions get added to the extraction resul. How do I avoid that?

@sharon.palawandram I see, let me make sure I understand your issue correct: you mean that, if you have a field, with suggestions, and do not change its extracted value in the Validation Station, you will receive the fields in the Extraction Result as results, not suggestions? as if it was a multi-value field? if that’s the case, it looks like a little bug - can you tell us how we can reproduce it/maybe share the workflow with us?

1 Like

Hello Monica,

If I have a field to be extracted, and there are suggestions, and they do not get validated with either validation station or action center, All values including suggestions are in the extraction result.

Here’s an example of my extraction result, here the document passes post extraction validation and gets exported to an xlsx document. All post extraction validations pass and they are true for the second row as seen below.

However, in exporting the extraction results, the suggested values for each field is also getting extracted on rows 3 4 5.

Im using Forms Extractor.


Also I will replicate and share the workflow with you shortly.