Fixed Table

Extracts tables with a fixed number of columns and returns their collated column contents. Anchor either on the table title or on a table column heading.

Use the Fixed Table method for tables in the same document type that always have the same column layout (same headings in the same order, same number of columns). This method can extract tables that span multiple pages and ignores repeated column titles on subsequent pages.

Parameters
Examples
Notes

Parameters

Note: For the full list of parameters available for this method, see Global parameters for methods. The following table shows parameters most relevant to or specific to this method.

keyvaluedescription
id (required)fixedTableWhen you specify this, you must also specify "type": "table" in the field's parameters.
columnCount (required)integerThe number of columns the tables must have.
columns (required)arrayAn array of objects with the following parameters:
-id (required): The id for the column in the extraction output
- index (required): A zero-based column index
-type : The table cell's type. For more information, see types
-isRequired (default: false): If true, Sensible omits a row if its cell is empty in this column. If false, Sensible returns nulls for empty cells in the row. Note that if you set this parameter to true for one column, Sensible omits the row for all columns, even if the row had content under other columns.
stopMatch object. default: none(Recommended) Stops table recognition at the matched line. Otherwise, Sensible searches all pages for tables, which can impact performance.
startOnRowinteger. default: 0Zero-indexed row number at which to start table extraction. For example, use this to exclude column headings from the output. As a stricter alternative, set the Is Required parameter on a column and set a type on the column (see example in Examples section).

Examples

The following example shows extracting two columns from a fixed table in the Sensible app.

  • In order to omit column headings, the config specifies "type": "number" and "isRequired": true for the column col4_rank_last_month . You can also use "startOnRow":1 to omit headings.
  • To improve performance, the config specifies a Stop parameter.

Config

{
  "fields": [
    {
      "id": "agile_risks_table",
      "anchor": "agile software",
      "type": "table",
      "method": {
        "id": "fixedTable",
        "columnCount": 4,
        "columns": [
          {
            "id": "col1_risk_description",
            "type": "string",
            "index": 0
          },
          {
            "id": "col4_rank_last_month",
            "type": "number",
            "isRequired": true,
            "index": 3
          }
        ],
        "stop": {
          "type": "startsWith",
          "text": "project managers"
        }
      }
    }
  ]
}

Example document
The following image shows the example PDF used with this example config:

Click to enlargeClick to enlarge

Example PDFDownload link

Output

{
  "agile_risks_table": {
    "columns": [
      {
        "id": "col1_risk_description",
        "values": [
          {
            "value": "Poor task point estimation",
            "type": "string"
          },
          {
            "value": "Poor epic scope definition",
            "type": "string"
          },
          {
            "value": "Inadequate scrum master training",
            "type": "string"
          }
        ]
      },
      {
        "id": "col4_rank_last_month",
        "values": [
          {
            "source": "2",
            "value": 2,
            "type": "number"
          },
          {
            "source": "1",
            "value": 1,
            "type": "number"
          },
          {
            "source": "3",
            "value": 3,
            "type": "number"
          }
        ]
      }
    ]
  }
}

Notes

If tables have variable column layout, use the Table method instead.

For examples of extracting from complex tables, such as tables inside tables or tables with labled rows and columns, see Sections.


Did this page help you?