SetFieldConfidence
Sets the confidence for all characters in a field to the same value.
Syntax
bool SetFieldConfidence ()
Parameters
Target: String. A smart parameter that resolves to a DCO field node.
NewConfidence: String. The confidence value (1-10) to be assigned to the field's characters. If the parameter is invalid or out of range, it will default to 10, which is the highest confidence.
Smart parameters are supported for all parameters.
Returns
Always True. If the target input parameter is invalid, no confidence levels are changed and a message is logged.Level
Any level.Details
This action unconditionally sets the confidence values for every character within a field to a specific value. This action can help change confidence levels when the preceding actions are all successful and it is desired to update the field confidence automatically to show that all characters are valid. Conversely, it is possible to set all of the characters to a low confidence value to ensure that the characters are all reviewed in a follow on process or in a verification panel.
If a field has text such as "Hello Datacap" and the characters were recognized in order with these confidences, "8,8,8,8,4,4,8,8,8,3,9,9", calling this action with a confidence value of 8 will set the confidence for each character in the field to a value of 8, regardless of its current value.
For example, if a set of calculations involving one or more fields is successful, this may indicate that the confidence level of those fields' values should be forced to a high confidence - regardless of the confidence set by the recognition engine. After the success of the calculation, the rules can call SetFieldConfidence("@P\MyField","10") to unconditionally re-set the confidence values of the fields to the highest possible confidence. The examples below show how the ValidationsAndTextAdjustments action CalculateFields could be used to automatically validate the results of field recognition. Applications can have other kinds of use cases that would allow a field to be automatically validated and set to a high confidence without requiring operator interaction. Another example could be a database look-up of a recognized name, or other automatic type of confirmation that one or more fields are believed to be recognized correctly even if the recognition engine is unsure of some of the characters.
When viewing the confidence directly in the field level XML, values are actually 0 - 9 to permit one character to reflect the value of each character within the xml. This illustrates that to the user the range is exposed as 1 - 10 but internally it is sometimes treated as 0-9. When developing and debugging an application, be aware of this potential situation.
SetFieldConfidence("@P\GrossSalary", "10")
This example sets all characters
in the field "GrossSalary" to a confidence of 10. The action could be called on a page level DCO
node or on a sibling field level DCO node and the smart parameter would resolve correctly as first
it would resolve to the current page and then to the child DCO node called "GrossSalary".SetFieldConfidence("@P\AdjustedPay" , "1")
Similar to the previous example,
this one will lower the confidence of each character in the field "AdjustedPay" to a low confidence
of 1. If called on a page level node, it will navigate from the current page to find the child
"AdjustedPay". If called on a field level node, it will navigate up to the parent page, then look
for the sibling field "AdjustedPay".SetFieldConfidence("@X", "1")
Similar to the previous action, however this
one would be expected to be called directly on a field level DCO node and the current field's
confidence would be adjusted.CalculateFields("@STRING('1TotalWages' + '2TaxableInterest' + "3Unemployment' = '4AdjustedGross')")
SetFldConfidence("@P\1totalWages", "10")
SetFldConfidence("@P\2TaxableInterest", "10")
SetFldConfidence("@P\3Unemployment", "10")
SetFldConfidence("@P\4AdjustedGross", "10")
If
the calculation works, the application can assume that all of the characters are read correctly
because all of the fields summed up to the correct value and SetFieldConfidence can adjust
the fields to high confidence. Note, in this example it would be a good practice to also add a check
that the values are all non-zero to eliminate a completely "bad read".