SelectParentBlock

Looks for the first occurrence of a word or phrase that matches the regular expression. If a match is found, the next action will change the currently selected block from the found word to the entire line that contains the word. SelectParentBlock is then called again to change the selected block to the parent of the current line, then the current field zone is updated to contain the entire set of lines contained in the current block and the field value is set to all of the text within the current block. This action utilizes the document block layout created by the DocumentAnalytics actions.

Important: This action is currently released as a preview. If you use this action in your application, you might need to make updates to your application if a new version of this action released.

Syntax

bool SelectParentBlock () 

Parameters

None.

Returns

True if the word or phrase is located on the page. Otherwise, False.

Level

Page or field level.

Details

The currently selected block, which denotes an area on the page, is changed to the containing block. This effectively makes the new area of interest larger than the previous area.

For example, if the currently selected block is a word, when SelectParentBlock is called, the selected word remains the same, but the area of interest is changed to the parent block, which would be the entire line. Subsequent actions that act on the current block now respects the line as the area of interest on the page.

Calling SelectParentBlock again moves the selected block to the parent of the line. Determining which block gets selected depends on the layout of the page. One scenario is that the selected block will now be a paragraph that contains multiple lines, including the word that was previously found. Any block actions, such as additional searches, will be run within the boundaries of this newly selected paragraph block.

While the block nesting layout often follows the same pattern, the layout of blocks will depend on the layout of text on the page. For predictable results, the application rules might need to work on expected layouts based on the page types that are supported by the application.

Example
RegExFind_InBlock("Da.e")
SelectParentBlock()
SelectParentBlock() 
UpdateFieldWithBlock()

RegExFind_InBlock will look for the first occurrence of a word or phrase that matches the regular expression. If a match is found, the next action will change the currently selected block from the found word to the entire line that contains the word. SelectParentBlock is then called again to change the selected block to the parent of the current line, then the current field zone is updated to contain the entire set of lines contained in the current block and the field value is set to all of the text within the current block.