Direct Extract
Direct extract copies selected text from the document viewer into a form field verbatim, applying automatic type conversion (e.g., parsing a date string into a date value). It is the simplest extraction method and is best suited for fields where the document text exactly matches the desired attribute value. Enable direct extract by settingallowDirectExtract: true in the editorOptions on a v2:attributeEditor:
AI Extraction on Attribute Editors
AI extraction sends the page text and the user’s selected text to an LLM, which extracts values for multiple target fields simultaneously. This is useful when a single text selection contains information for several related fields — for example, selecting an invoice header block to populate the invoice number, date, and vendor name at once. Enable AI extraction by adding anaiExtraction object to editorOptions:
AIExtractionConfig object accepts the following properties:
When
aiExtraction is configured, showAddFromSelection is implied — the editor displays a sparkle button when the user has an active text selection in the document viewer. Clicking the button triggers the LLM call, and the returned values are written into each target field. An empty field shows the placeholder “Select text in document, then click to extract” by default.
AI Extraction on Grids
Grids support their own AI extraction configuration for tabular and repeating data. When configured on av2:grid, an “AI Extract” button appears in the grid toolbar. Clicking it sends the page text and selection to an LLM, which extracts multiple rows and creates a data object for each one.
AIGridExtractionConfig shares the same prompt, promptRef, and modelType properties as the attribute-level config. The key difference is targetPaths — when omitted, the grid automatically derives targets from all enabled, non-group children of the grid’s taxon, so you only need to specify targetPaths if you want to limit or annotate the extracted fields.
Choosing an Extraction Method
For a complete reference of
v2:attributeEditor and v2:grid props, see Data Components.