MetaTool > Help > Extraction > Set Field Value
060-670 MetaTool Extraction Edit – Set Field Value
It’s often used to run the OCR engine only once and copy the result to different index fields for further modification. In that way, the original OCR text stays intact and only the copied text is manipulated for each index field individually. You typically define an OCR extraction rule first to hold the full text of a scanned document in an index field you call Text Block or Full Text. Next, you would define a Set field value rule to copy the result in an index field for further processing.
The Set field value rule is also useful to set default values and for setting values depending on certain conditions. For example, the CaptureBites Email Export Connector works with index fields to set the subject, email to, email from addresses, etc. All these index fields can be set to a fixed value up front with MetaTool Set field rules. If the values change, you just change the value in the rule and you don’t need to drill down to the Email connector setup. You can even switch to another email address if a certain condition is met.
01 Set field value – Add Rule
Set field value rules are defined in the MetaTool Extract tab.
Press the Add button and select Edit – Set field value to add the rule.
02 Set field value – Setup
In our example we will make use of the CB MetaTool Floating Data job. This job is automatically installed when you install CaptureBites MetaTool.
From below image samples we want to extract the Account Number, Reference, Date and Category and email the documents using the CaptureBites Email Connector
After defining an Advanced OCR rule to load the full text in an index field called “Text Block”, we will copy this text in the Account Number index field.
In the Set field value rule, we select the index field to hold the data.
In this case we select the index field “Account Number”.
In the Value field, we place the Text Block index field value which you can simply pick from the Setup menu.
We optionally enter a description.
Next we would define a Replace text rule to correct any OCR errors or replace / with -, and Find line and Find word rules to extract the account number. We would follow the same process for the other fields:
We would follow the same process for the other fields: Reference, Date and Category. Because we always start from a copy of the original full text for each of the fields with a Set field rule, any rules to correct or change the data will only apply to that field and will not affect the other index field values.
Next follows an explanation about the more advanced options:
An example for applying the rule on only the first document is when you need to enter a handwritten value during manual validation. You could set a default value for the first document only, make this a sticky value in validation and you would only need to enter another value during validation when it changes. It’s like setting the first value of a sequence.
For example:
We want to extract the invoice numbers in the third row on the below check and list them in the body of an Email sent to the customer using the CaptureBites Email Export Connector.
The result after OCR extraction of the green zones is:
We want to add a sequential line item number in front of each invoice number. To do this, we enable Multi-line mode and add the Line Number value followed by a “)” and a space in front of the multi-line content of the Email Body index value.
The Value Setup will be explained in more detail later.
In our example, we want to change the default Email To value, that we pre-set in the beginning of this help page to mortgage@capturebites.com. However, we want to set the email address to the manager’s Email when the Category value is equal to AA.
We select the “If field value is equal to” in the Set field value setup and press Setup next to the condition.
1) If index field: select the index field that needs to be evaluated
2) is equal to/ is not equal to/ is greater than/…: here you type in the value your index field needs to be compared with. By pushing the Setup button, you can also select different system and index values to compose your value. In our example we just type AA
When the Category is not AA, the email defaults to mortgage@capturebites.com
Example case: the Tax Amount is erased from the second invoice because the goods are free of tax. In this case, the OCR engine will detect a blank.