Skip to main content
ABBYY FlexiLayout Studio has several special features for developing additional FlexiLayouts for invoice projects:
  • You can specify the locations of elements relative to the regions of fields that were detected when the main FlexiLayout from the invoice project was applied.
  • Identifiers of vendors and business units can be used in requests to the data set of the Document Definition.
  • Lists of keywords and other parameters of a FlexiLayout can be exported to an XML file, allowing you to edit them without editing the FlexiLayout or the Document Definition.

Create an additional FlexiLayout

1

Open a batch in FlexiCapture

Open a batch with recognized invoices in FlexiCapture.
2

Create a FlexiLayout Studio project

Create a new project in ABBYY FlexiLayout Studio. On the main menu, select Tools → Export Batch to FlexiLayout Studio → Create New FlexiLayout Studio Project….
This command is only available for FlexiCapture projects that are stored on your computer. If you are using the Distributed version of FlexiCapture and the project is stored on the server, first download it to your computer by clicking Export Project… on the Project menu.
The suffix of the ABBYY FlexiLayout Studio project indicates the version of the Document Definition at the time of the project’s creation.
The ABBYY FlexiLayout Studio project you just created contains all the documents from the FlexiCapture batch, plus the field regions detected during recognition, in the form of a reference layout.

Add a field to an additional FlexiLayout

To add a field to an additional FlexiLayout, create a block for this field and specify its search element. Fields in the Document Definition must have unique names. This means that:
  • To describe the search logic for a field, create a block with a unique name.
  • To change the search logic for a field that already exists in the Document Definition, create a block with the same name.

Add pages to an additional FlexiLayout

If you want to test the changes you have made to an additional FlexiLayout on new images, you can export your FlexiCapture batches into an existing invoice project in ABBYY FlexiLayout Studio. To export your batches, click Tools → Export Batch to FlexiLayout Studio → Add to Existing FlexiLayout Studio Project….
  • You can export FlexiCapture batches only into ABBYY FlexiLayout Studio projects that were created by selecting Tools → Export Batch to FlexiLayout Studio → Create New FlexiLayout Studio Project….
  • When you export a FlexiCapture batch to ABBYY FlexiLayout Studio, a new batch is created in ABBYY FlexiLayout Studio for that batch.
  • If the new Document Definition has more fields than the Document Definition used for the ABBYY FlexiLayout Studio project, the export log contains a warning for each extra field.
  • To make the program export the extra fields, for each extra field add a block with the same name in the CommonBlockRegions node of the SearchElements tree.

Make requests to data sets from the Document Definition

You can find a sample request in the DataSetRequestSample element. This element is disabled by default.

Functions

Syntax:
  • The path to the Document Definition and the name of the data set are used to access the data set when working with a FlexiLayout in ABBYY FlexiLayout Studio.
  • After a compiled FlexiLayout is added to a Document Definition in FlexiCapture, only its name is used when accessing the data set.
  • connectionString format:
    Note: Separate parts of the path with double backslashes (\\).
  • searchFields — Array of names of columns from which values need to be retrieved.
  • searchCriteria — Array of Column-Entry pairs; returns all values if empty.
    • If a request contains multiple values for one field, use the OR operator.
    • If a request contains multiple values each of which corresponds to only one field, use the AND operator.
    • If a request contains multiple values for one field and values for multiple fields, use the OR operator to distinguish multiple values for one field and the AND operator to conjoin values for various fields.

Search for rows from a column in an external database on an image

1

List the columns

Use FieldNamesOfFCDataset to get a list of columns sorted in ascending order of their index numbers.
2

Find the column index

Determine the index number of the column from which you need to find data.
3

Build the filter

Create an array of conditions for filtering data from the data set.
4

Run the search

Pass the index numbers of the column and the filter conditions to SearchTextFromFCDataSet (or RegularExpressionFromFCDataSet, if you need to use regular expressions).
This code is automatically generated when a recognized batch is exported from FlexiCapture.

Search an image for entries from multiple columns

Since search parameters are replaced each time you call the SearchTextFromFCDataSet function, calling it repeatedly has no effect. As a workaround, get strings from an external database and pass them to the SearchText function, which adds each string to the existing search parameters instead of replacing them.
1

List the columns

Create an array of names of columns from which you need to find data.
2

Build the filter

Create an array of filter conditions for filtering data from the data set.
3

Count the entries

Determine the number of entries that are returned using the RecordCountOfFCDataset function.
4

Prepare the query

Prepare query data using the PrepareRecordsetOfFCDataset function.
5

Read each record

Go through all records and get the array for each record using the RecordOfFCDataset method.
6

Pass the values to SearchText

Pass the value of each element in the array to the SearchText function.

Additional considerations for complex columns

  • The FieldNamesOfFCDataset function returns an array that contains multiple occurrences of the name of the complex column. The number of occurrences is the same as the number of column instances in an encoded external database. Example: {VendorId, VATID, Name, Name, Name, City}. In this case, the external database contains three columns for the one complex column Name in the data set.
  • If SearchCriteria contains a condition for a field that corresponds to a complex column (like in the example above), this condition is used to check all of these column instances.
  • If searchFields contains a condition for a field that corresponds to a complex column (like in the example above), the result contains the array of values from each column instance. For example, if you request the following for {VendorId, VATID, Name, Name, Name, City}:
  • You can get a list of columns that are returned by passing the searchFields array to the FieldNamesOfFCDataset function.

Make a request to an XML file that contains FlexiLayout settings

You can make requests to an XML file with FlexiLayout settings using two standard functions that are described in the documentation for ABBYY FlexiLayout Studio:
To use this file when working on a FlexiLayout in ABBYY FlexiLayout Studio, place it in the project folder or one of its subfolders. The path to the file is relative to the ABBYY FlexiLayout Studio project file. If you load a compiled FlexiLayout to a Document Definition in FlexiCapture and use it as an additional FlexiLayout, the XML file is placed in the Templates folder and you can edit it. When the FlexiLayout is applied, the program manages access to this file automatically.