Google Drive Document to Dataverse Indexing
When a document is added to a Google Drive folder, the flow extracts its text, classifies it with AI, stores key metadata and a searchable summary in a Dataverse table, and marks the file indexed. Builds a searchable index of Google Drive documents inside Power Platform.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
Google Drive Document to Dataverse Indexing builds a searchable index of Google Drive documents inside Power Platform. On an hourly schedule the flow polls a Google Drive folder, extracts each new document's text, uses Azure OpenAI to classify and summarize it, and writes a searchable index row to a Dataverse table. The index turns an unsearchable Drive folder into structured, queryable records that Power Apps, Power BI, or search experiences can consume.
Why it matters: A shared Drive folder is hard to search. An AI-derived summary, classification, and keywords stored as governed Dataverse rows make every document discoverable and app-ready.
Status: Built. Ships Off (demo). Flow Checker: 0 errors / 0 warnings.
Use Case
A team accumulates documents in a shared Google Drive folder and needs them indexed and summarized for retrieval. Instead of manually cataloguing files, the flow continuously discovers new documents, derives an AI summary + classification + keywords, and stores them with the file metadata in Dataverse — a governed, app-ready index.
Flow Architecture
Recurrence Poll Drive Folder
Recurrence (Hour/1)Hourly poll (Drive has no new-file trigger).
Initialize config
Initialize VariableSource folder id, index table, model deployment, truncation length, system prompt, and the indexed-file-id array.
List Drive Files
Google Drive — ListFolderList folder contents.
Filter Files Only
Filter arrayDrops subfolders (IsFolder eq false).
List Indexed Records
Microsoft Dataverse — ListRecordsReads existing index rows.
Select / Set Indexed FileIds
Select + Set VariableProjects existing rows to an array of Drive file ids for dedup.
Foreach File
Apply to each (sequential, concurrency 1)Iterates Drive files.
Condition Not Already Indexed
ConditionSkip if the file id is already indexed.
Get File Content
Google Drive — GetFileContentDownloads file bytes.
Compose Document / Truncated Text
ComposeDecode bytes to text and truncate to varMaxChars.
Compose Chat Messages
ComposeBuild the system+user message array.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_IndexFolderId | String | REPLACE_WITH_DRIVE_FOLDER_ID | Google Drive source folder id. |
| flowlibs_IndexTable | String | flowlibs_docindexes | Index table entity-set name. |
| flowlibs_OpenAIDeployment | String | gpt-4o-mini | Azure OpenAI deployment name. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Google Drive | shared_googledrive | ListFolder GetFileContent |
| Azure OpenAI | shared_azureopenai | ChatCompletions_Create_2024Feb15Preview |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Vector search
- Store an embedding (Azure OpenAI embeddings) alongside each row in Azure AI Search for semantic retrieval.
- PII redaction
- Redact sensitive entities before sending text to the model and before storing the summary.
- OCR for scanned docs
- Insert an Azure Document Intelligence step (HTTP) between Get File Content and the model to handle image-only PDFs (requires a provisioned Document Intelligence resource).
- Richer classification
- Extend the system prompt and the Parse JSON schema (e.g. add sensitivity, owner, expiryDate).
- Notify on index
- Add a Teams or Outlook action after Create Index Record for high-value categories.
- Tune cost
- Lower varMaxChars or switch flowlibs_OpenAIDeployment to a cheaper model.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Files only
Keep files, drop subfolders.
EXPR.02Dedup guard
Skip files already in the index.
EXPR.03Decode file text
Decode the downloaded bytes to text.
EXPR.04Truncate
Cap the text length for token-cost control.
EXPR.05Model output text
Read the model's completion text.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.