Document Insights

Schema Model (Google Gemini)

This page describes the data model used by the Document Insights application when integrated with Google Gemini, an OCR solution for parsing and reviewing Custom Forms. The model is designed to support template-based extraction, field mapping, and confidence-based review workflows.


🧩 Object Relationship Overview

  • Document Insights stores the OCR results of a submitted custom form.

  • Document Insight Template stores the mapping configuration used to extract fields from the custom form.


🧾 Object Schema

1. Document Insights

Stores the OCR result of a Custom Form parsed via Google Gemini, including extracted field statuses and confidence matrix.

Field

Description

Status

Overall processing status (e.g., Completed, Failed, In Progress).

Status Description

Additional detail for the status (e.g., "All fields matched", "3 fields missing").

Confidence Matrix (LWC)

A Lightning Web Component that displays:

  • Parsed value per field in tabular format.


2. Document Insight Template

Defines the template structure and field mappings used to extract data from custom forms submitted via Google Gemini.

Field

Description

Intelligence Model Name

Name of the custom form template (e.g., “Loan Application Form”, “Credit Report Summary”).

Source Object

API name of the Salesforce object where the extraction process will initiate.

AI Intelligence Engine

Google Gemini

Target Record

API name of the Salesforce object where the extracted fields will be mapped (The record can be updated or created based upon Source Object).

Data Field Mapping (JSON)

JSON structure defining how OCR fields map to Salesforce fields (key = OCR label, value = API field name).

Prompt

The prompt to be sent to Google Gemini AI engine to parse the required fields from the file uploaded.


📊 Visual Overview

Screenshot 2025-07-14 at 4.43.39 PM.png