ContentAnalyzerFindExtractedText

Populates a field or variable using a value populated in Layout XML file through ContentAnalyzerCreateLayout action.

Syntax

bool ContentAnalyzerFindExtractedText ()

Parameters

target: String. The target DCO object where the value is saved. If used on a field use '@F' to update the current field.

scope: String. First|Last|All - Populates the target using the match(es) using the specified key or keyclass. If First is specified the first match is used. If Last is specified the last match is used. If All is specified a sub field is created for each match. All is only supported when the target is detail field and is not supported for variable.

key: String. Name of the key to match. This key is returned by the Content Analyzer service.

keyclass: String. Name of the key class to match. KeyClass returned by Content Analyzer service for Key value pairs. First priority to the key class parameter.

The Key or Keyclass parameter must be provided, or both may be provided. If both the parameters are provided, the keyclass parameter is used for the search first.

Key-value pairs returned by Content Analyzer always have a "Key". Depending on the ontology definition, a "KeyClass" entry may or may not be returned by the service. If the KeyClass is blank, then the action looks for the key-value pair specified in the Key parameter. If both the Key and KeyClass are provided as parameters and if the KeyClass is not found in a key-value pair, then Key parameter is used for the search. If there is a match for the specified key, it is able to populate the field correctly and return true.

All parameters support Smart Parameters.

Returns

True if able to populate the field correctly and if data is correctly available, else False.

Level

Page Level.

Details

Important: The Content Analyzer result is returned by ContentAnalyzerGetOutput action in JSON format and stored in the batch in JSON. To transfer the data to the layout file, the action ContentAnalyzerCreateLayout must be called prior to this action to find the extracted text. When the layout file is generated, the key-value pairs are also placed into the layout xml file.

The Layout xml file and Page xml file (Datafile) must exist before calling the ContentAnalyzerFindExtractedText action.

Example
ContentAnalyzerConfiguration("url","@APPVAR(values/gen/FunctionalID)","@APPVAR(values/adv/Password)","@APPVAR(values/adv/APIKey")
This action uses the provided credentials and URL to connect to the Content Analyzer service. It is typically called on the batch object.
ContentAnalyzerSubmitRequest("True,"True","False","True","Invoice","True","","","","","False")
This action is used to submit the request to Content Analyzer. It stores the AnalyzerID in the variable AnalyzerRequestID. In order to call ContentAnalyzerCreateLayout action later, the FullPageRecognition parameter must be set as True. Refer parameters section of this action for more details.
ContentAnalyzerGetOutput()
This action saves the JSON output file and the DocumentClass in DCO variable.
ContentAnalyzerCreateLayout()
This action converts the JSON output file to a layout xml file. The file name is saved in Layout in DCO variable.
Example 1
ContentAnalyzerFindExtractedText("@P\Invoice_Date","First","","InvoiceDate")
This example assumes action is called at Page level, where the page field "Invoice_Date" is expected to be populated with the value returned by the Content Analyzer service corresponds to the key class "InvoiceDate". The scope First denotes the first occurrence of this key to be searched and its value to be used.
Example 2
ContentAnalyzerFindExtractedText("@P\Airfare","Last","airfare","")
Because the key class is not provided to the action, the key "airfare" is used to populate the value to the text property of child field "Airfare". The scope Last denotes the last occurrence of this key is searched and its value is used.
Example 3
ContentAnalyzerFindExtractedText("@P\Airfare","First","airfare","Airfare")
Because this example provides both the key class and key, the search is on keyclass Airfare and if the keyclass "airfare" is not found in the key-value pair results then it does not populate the value to the child field "Airfare".
Example 4
ContentAnalyzerFindExtractedText("@P\DateDetail","All","Date")
This example creates a line item for each Key Date found in the document. The following document hierarchy is expected to be defined.

Field DateDetail

- Field LineItem

- - Field Date