Community

Dynamic Search Area for Repeating Group Instances in FlexiLayout Studio

Hi,

Is there a way to define a dynamic search area, which would change for each instance of a repeating group in FlexiLayout Studio 12?

I am building a layout for extracting data from a document with table-like structure where the result should ideally be like a de-pivoted table version. I have tried using a script in the advanced pre-search relations of the repeating group element. The code defines the search area by looping over the instance values for each "row id" (year) and "column name" (date). However, it seems that ABBYY generates the search area as the sum of all single areas/cells from the loop and recognizes only one of the values in this area, instead of searching through each single area separately/per instance:

 

The target format at the end should be like:
Jahr (Year): 2020
Datum (Date): 01.07.
Betrag (Amount): -123.456,00

Jahr: 2021
Datum: 01.01.
Betrag: 123.456,00

Jahr: 2021
Datum: 01.10.
Betrag: 123.456,00
...

where the values for year and date can appear in more than one instance. Additionally, the table borders would not necessarily be visible in each document. 

Any ideas on how to achieve this will be highly appreciated.

0

Comments

2 comments

  • Avatar
    Rahul Kapoor

    I can think of 2 ways to implement this:

    (I) Take 'Daten' as anchor field and then using combination of elements use the different amounts as your first element in the repeating group. It is very important to keep the Amount as your first element as the number of output rows in your repeating group depends upon the number of Amounts. Once all amounts are captured, look for the corresponding year and date.

    (II) It is possible to achieve the end result but with a different procedure as well. You first have to capture everything in this table using a Table element or a repeating group. After that you need to de-pivot the table using a script.

    Regards,
    Rahul Kapoor

     

    1
  • Avatar
    Kali N.

    Thank you for the ideas, Rahul.

    The first option worked out fine. It turned out that the Region Element within rgDaten was only helpful for previewing the search area defined with the advanced pre-search relations code. After deleting this element, ABBYY found all instances of cBetrag correctly.

    0

Please sign in to leave a comment.