Skip to main content

Document

Overview

The Document component stores and renders a single structured document — typically an invoice or similar commercial document — on a record. It shows the stored PDF next to the data extracted from it, and lets you correct that data by hand.

This component does not upload files, run OCR, or call an AI model itself — extraction is done by an AI workflow (an "AI — processar documento" action, configured in Workflows or via the Document view's Workflow AI setting). The Document component only displays and edits the structured result once it exists on the column value, and saves manual corrections back to it.

Use it when a record needs a single canonical document (an invoice, a delivery note, a contract) whose header fields and line items should be reviewable and correctable inside the record itself — not for general file storage or a document library (for that, see the Document view).

Document types

The Visualisation type setting picks which editor renders the column's data:

TypeBehavior
Fatura (Invoice) — defaultEditable header fields, an editable line-items table (with totals, IVA and discounts), header/line mapping, and auto-matching
Genérico (Generic)A read-only structured-data viewer. There is no write-back yet for this type, so it never shows editable fields, and the Mapeamento / Auto-Matching tabs are disabled with an explanatory message

Configuration

The config panel has three tabs: Configuração, Mapeamento, and Auto-Matching. The last two only apply to the Fatura type.

Configuração

SettingDescription
Texto do botãoLabel of the button that opens the editor in form view
Texto de ajudaHelper text shown near the button
Tipo de visualizaçãoFatura or Genérico — see Document types above
Tamanho máximo do arquivo (MB)Maximum file size accepted
Processar todas as páginasWhen off, reveals Máximo de páginas a processar to cap how many pages are considered
Combinar texto de todas as páginasJoins the extracted text of every page into one block
Tipos de arquivo aceitosPDF, JPG, JPEG, PNG, BMP, GIF, WebP — PDF cannot be unchecked; images are automatically converted to PDF before processing

Mapeamento (Fatura only)

  • Mapeamento do Cabeçalho — maps a fixed list of header fields from the extraction (supplier name/address/tax ID, document number/date, totals, payment method/terms, etc.) to columns on this feature. This drives which fields appear — and are editable — in the editor's Cabeçalho tab, in the feature's column order.

The Salvar documento, Preenchimento automático and Configuração das Linhas controls (target feature, line-number column, header ↔ lines link, and line-field mapping) were removed from this panel: they had no runtime effect. Only Mapeamento do Cabeçalho stays configurable.

Auto-Matching (Fatura only)

Lets individual header or line fields search another feature for a matching record as you type, instead of storing free text.

SettingDescription
Ativar Auto-MatchingTurns on auto-matching for the line Description field — the only line field with live search. Configured directly, with no dependency on line mapping
Ativar Auto-Matching no CabeçalhoTurns on auto-matching for header fields already mapped in Mapeamento do Cabeçalho
Per field: Feature onde procurarThe feature searched for a match
Per field: Coluna onde procurarColumn compared against the extracted text
Per field: Coluna do ID/valorColumn whose value is stored once a match is confirmed
Header fields also have: Coluna para mostrarColumn shown as the human-readable label for the match

Matches at or above 70% similarity are linked automatically (green check + record); below that, the field shows an "adicionar" prompt instead. You can toggle a matched field back to the originally extracted text.

In forms

The button opens a fullscreen editor. On desktop, Cabeçalho and Linhas tabs sit side by side with the PDF; on narrow screens a third Documento tab shows the PDF instead.

  • Cabeçalho — the fields defined by Header mapping, editable inline (with auto-matching where configured).
  • Linhas — an editable table (Descrição, Preço Unit., Qtd, Un, Total, IVA %) with per-row add/remove, three discount fields (S/IVA, IVA, Total), and totals that recalculate live as you edit.

There is no separate save button that "commits" versus a cancel that discards: Guardar rascunho saves the current draft without closing, and the close (✕) button saves the draft too before closing — a failed save keeps the editor open instead of losing the edits.

For the Genérico type, the same fullscreen editor opens but is entirely read-only.

In tables and other views

Table, list, kanban, calendar, and execution views show a Ver documento icon button that opens the same editor read-only. If the document has been processed by the workspace's AI Struct integration, a compact status badge appears next to the button:

Por processar (no staging yet) · Pendente · A processar · Em staging · Rascunho · Validado · Duplicado · Importado · Ignorado · Erro

Tips

  • Nothing populates this field automatically on its own — either fill the Cabeçalho/Linhas tabs by hand, or wire an AI workflow to the column's source document (see the Document view and Integrations).
  • PDF is always an accepted file type and can't be excluded; opening the config panel also re-adds any image extensions you previously unchecked.
  • Auto-matching here always runs at a fixed 70% confidence threshold — unlike the standalone Auto Match component, this threshold isn't configurable.