DiscoveryVIPAll guides

GEMINI WORKSPACE LAB

Gemini AI & Workspace Automation

Repair an invoice extraction, confirm it against the document, and approve a simulated spreadsheet row.

Help & starter walkthrough

Start here

Learn how to check data extracted from a document before approving it for a spreadsheet. The opening response is prerecorded, so the exercise works without a Gemini key.

  1. Find the type errorChoose Invoice extraction and click Load invalid fixture, then Validate JSON. Expect $.total must be a number. Find the quote marks around "113" in Structured JSON.
  2. Repair and check the sourceChange "total": "113" to "total": 113. Click Validate JSON. Then compare the total, currency, and evidence with Total: 113.00 CAD in the source.
  3. Review and approveClick Open review. Enter Workshop reviewer and Checked total and currency against the invoice in the reviewer and reason fields. Check I checked the source and supporting excerpt. Click Approve record, then Add to simulated sheet. Expect a row with 113 and CAD.
Detailed walkthrough, examples, and troubleshooting

Practice rejection and uncertainty

  1. Load the reference invoice again. Keep total numeric but change it to 100. Click Validate JSON. A numeric subtotal can pass the schema even though the source says the final total is 113.
  2. Click Open review, enter a reviewer and the reason Subtotal used instead of final total, and click Reject record. The simulated sheet gains no row. Inspect the decision in Review audit.
  3. Try replacing evidence with Payment made yesterday. Validate again. The schema may pass, but the lab flags that the exact excerpt is absent.

Compare evidence and experiment with prompts

  1. Open Retrieval & evaluation. Search for total CAD and click Rank source chunks. Read the text offsets and matching words.
  2. Click Compare fixtures and current response. Compare each row’s schema result, exact field matches, and excerpt presence. Read the document yourself before deciding whether an excerpt supports a claim.
  3. Return to Extraction lab. Change the extraction prompt to Use the tax-inclusive total, not the subtotal. and click Save prompt version. In fixture mode, changing the prompt does not generate a new response.
  4. Open Lessons & projects and search for Compare shape with evidence. Try the exercise with a second template such as Policy question answering.

Save, export, or try a live request

  1. Open Export & live setup → Save locally to keep the draft in this browser. The draft requires fresh review after reload. Download project JSON also includes your source text and audit, so review the file before sharing it.
  2. Choose Code.gs or SETUP.md under Generated file, then click Download Apps Script ZIP to get the schema, review workflow, and instructions for an authorized Google test account. The ZIP excludes your pasted document.
  3. Open Optional live Gemini request only if the site operator has configured it. Use fictional text, enter the supplied operator key, check the permission box, and click Request live response. Validate and review the returned candidate before adding any row.

If a button is unavailable

  • Open review is disabled: repair any JSON errors and validate again.
  • Approve record is disabled: open review and check that the evidence appears exactly in the current document. Enter a reviewer and reason and confirm the evidence check.
  • Add to simulated sheet is disabled: approve first. Editing the prompt, document, or response sends the current record back to Draft.

Invoice extraction

Prerecorded fixture · no model or Workspace request

Help · Extraction lab and workflow picker

Choose a fictional workflow, then load its invalid or reference fixture. A fixture is a prerecorded answer. The prompt can be edited and versioned without changing that answer. Start with the invoice to practice fixing one field.

Document and prompt

Help · Document and prompt

Source document is the evidence you will check. System instructions, Extraction prompt, and Example or constraints describe the requested work. Save prompt version stores the wording. Text and Markdown import are local. The optional live request is a separate action.

Response and review

Help · Response and review

Structured JSON is the candidate record. Validate JSON checks the format and field types. Open review lets you check source accuracy. Enter reviewer and reason, approve or reject, then use Add to simulated sheet to complete an approved record. Editing returns the candidate to Draft.

Validation rules

Draft

Simulated spreadsheet

Help · Simulated spreadsheet and audit

The sheet shows approved records after you explicitly add them. The audit lists validation and review decisions. Compare the two when testing a rejection: the audit records it and the sheet does not gain a row.

Review audit

Practice structured AI workflows

Review a proposed structure and its evidence before writing approved data.

Apps Script learning path · Interactive guides