Skip to content

ExtractReview

<caos-extract-review>

the Extract capability’s binding: a typed field patch sorted by confidence, beside the explicit list of what would not map

May be placed on a record page, a page inside an app and a step of a guided flow.

Name Attribute Description Type Default Required
patch property only The extraction: { object, recordId?, values, confidence?, unmapped? }, exactly the shape the shipped ai_extract prompt declares as its output. A property, because it is structured data. An ABSENT unmapped means the extractor did not say — which is weaker than “nothing failed to map”, and is drawn as such. json none declared Optional
mappedHeading mapped-heading, markup only The heading over the fields the patch would set. text Fields this would set Optional
unmappedHeading unmapped-heading, markup only The heading over the values that would not map. text Would not map — left for a person Optional
emptyText empty-text, markup only What to say when the extraction produced neither a value nor an unmapped entry. text Nothing was extracted from this document. Optional
Name When it fires What it carries
caos-extract-open-source the source span of an unmapped value is pressed, and the extractor reported where it was { field, source, at } — field is null when the document said something no field claims

Not documented yet — this piece has not said.

Not documented yet — this piece has not said.

Not documented yet — this piece has not said.

Name Type What it tells you
rows CaosExtractRow[] The mapped fields, least certain first: scored rows ascending, then unscored ones alphabetically. Read it to drive a work list elsewhere without recomputing the ordering rule.
unmapped CaosExtractUnmapped[] What would not map, filtered to the entries that actually carry a source and a reason.
blocking boolean Anything would not map, or a mapped value is below 60% confidence. Read it to GATE sending the extraction onward — which is the difference between a review surface and a decorated one.
Part Which piece of it When it is there
::part(review) The outer column. Always
::part(summary) The count line above both sections. Always
::part(section) One of the two sections. Always
::part(section-heading) A section’s heading. Always
::part(row) One row in either section. Always
::part(field) The field name in a row. Always
::part(value) The extracted value. the row is a mapped field
::part(confidence) The reported confidence, or “not scored”. the row is a mapped field
::part(unmapped-row) A row in the would-not-map section. something would not map
::part(source) The source span, as a control that opens the document. the row is an unmapped value
::part(reason) Why the value would not map. the row is an unmapped value
::part(empty) The “nothing was extracted” line. the extraction produced nothing at all

After a document has been extracted and before anybody decides what to do with the result — the screen that answers “is this worth reviewing”.

  • CompareView — the decision is field-by-field accept or discard against the record’s current values. That is the proposal review surface; this one comes before it.
  • ValidationSummary — the problems are a save being refused rather than a document failing to map.
  • DataTable — extracted values are one column among many being sorted, filtered and exported. A table compares values; this finds the doubtful ones.

The summary is a role="status" live region, so an extraction that arrives with values it could not map is announced rather than only drawn. Every row carries an aria-label reading the field, the value and the confidence in words — “confidence not scored” rather than a silence a reader would take for zero — and an unmapped row reads the field it was headed for, the text it came from and the reason. A value of null reads “cleared”, because an instruction to empty a field is a change and must not sound like a row that failed to draw. A source span with no reported position is an inert control rather than an absent one, so the text stays readable.

Four fields, all scored, ordered least certain first — so the 71% row is the first thing read and the 99% rows are where they belong. The summary says all mapped and none in doubt.

{
"id": "example",
"section": "Everything mapped",
"columns": 1,
"items": [
{
"id": "extract_review_1",
"type": "component",
"key": "extract_review",
"inputs": {
"patch": {
"object": "invoice",
"recordId": "inv_4410",
"values": {
"number": "INV-4410",
"issued_on": "2026-09-30",
"total": 18400,
"currency": "USD"
},
"confidence": {
"number": 0.99,
"issued_on": 0.95,
"total": 0.99,
"currency": 0.71
}
}
}
}
]
}
<caos-extract-review id="extractReview1"></caos-extract-review>
// What an attribute cannot hold, set as a property — the same values the preview is drawn with.
const extractReview1 = document.getElementById('extractReview1');
extractReview1.patch = {
"object": "invoice",
"recordId": "inv_4410",
"values": {
"number": "INV-4410",
"issued_on": "2026-09-30",
"total": 18400,
"currency": "USD"
},
"confidence": {
"number": 0.99,
"issued_on": 0.95,
"total": 0.99,
"currency": 0.71
}
};

The case this piece exists for. Each refused value keeps the text it came from and the reason the field would not take it, and nothing has been rounded to the nearest legal value — which is what would have made this look like a clean extraction.

{
"id": "example",
"section": "Three values the fields would not take",
"columns": 1,
"items": [
{
"id": "extract_review_1",
"type": "component",
"key": "extract_review",
"inputs": {
"patch": {
"object": "invoice",
"values": {
"number": "INV-4411",
"issued_on": "2026-10-02"
},
"confidence": {
"number": 0.97,
"issued_on": 0.88
},
"unmapped": [
{
"field": "payment_terms",
"source": "net 45 days from receipt",
"reason": "the field accepts net 15, net 30 or net 60, and nothing else",
"at": 812
},
{
"field": "total",
"source": "18,400.005",
"reason": "the column holds two decimal places and this has three",
"at": 1044
},
{
"source": "delivered to the east yard",
"reason": "no field on this object claims a delivery location"
}
]
}
}
}
]
}
<caos-extract-review id="extractReview1"></caos-extract-review>
// What an attribute cannot hold, set as a property — the same values the preview is drawn with.
const extractReview1 = document.getElementById('extractReview1');
extractReview1.patch = {
"object": "invoice",
"values": {
"number": "INV-4411",
"issued_on": "2026-10-02"
},
"confidence": {
"number": 0.97,
"issued_on": 0.88
},
"unmapped": [
{
"field": "payment_terms",
"source": "net 45 days from receipt",
"reason": "the field accepts net 15, net 30 or net 60, and nothing else",
"at": 812
},
{
"field": "total",
"source": "18,400.005",
"reason": "the column holds two decimal places and this has three",
"at": 1044
},
{
"source": "delivered to the east yard",
"reason": "no field on this object claims a delivery location"
}
]
};

Two cases a naive list gets wrong. reference has no reported confidence and reads “not scored” at the END, rather than sorting to the top as a zero. notes is a null, which is an instruction to clear the field, and it reads “cleared” rather than as an empty cell somebody would approve without seeing.

{
"id": "example",
"section": "An unscored field, and one being emptied",
"columns": 1,
"items": [
{
"id": "extract_review_1",
"type": "component",
"key": "extract_review",
"inputs": {
"patch": {
"object": "invoice",
"values": {
"number": "INV-4412",
"reference": "PO-77120",
"notes": null
},
"confidence": {
"number": 0.93,
"notes": 0.44
}
}
}
}
]
}
<caos-extract-review id="extractReview1"></caos-extract-review>
// What an attribute cannot hold, set as a property — the same values the preview is drawn with.
const extractReview1 = document.getElementById('extractReview1');
extractReview1.patch = {
"object": "invoice",
"values": {
"number": "INV-4412",
"reference": "PO-77120",
"notes": null
},
"confidence": {
"number": 0.93,
"notes": 0.44
}
};

No values and no unmapped entries. Said in a line rather than drawn as two empty headed sections, which would read as a surface that has not finished loading.

{
"id": "example",
"section": "Nothing came out of the document",
"columns": 1,
"items": [
{
"id": "extract_review_1",
"type": "component",
"key": "extract_review",
"inputs": {
"patch": {
"object": "invoice",
"values": {}
}
}
}
]
}
<caos-extract-review id="extractReview1"></caos-extract-review>
// What an attribute cannot hold, set as a property — the same values the preview is drawn with.
const extractReview1 = document.getElementById('extractReview1');
extractReview1.patch = {
"object": "invoice",
"values": {}
};