# DOCUMENT Functions

### Function List

* CORPDEV.GRDIVE\_INDEX
* CORPDEV.GRDIVE\_DOCUMENT\_QUESTION
* CORPDEV.GRDIVE\_DOCUMENT\_EXTRACT\_FIELD
* CORPDEV.GRDIVE\_DOCUMENT\_EXTRACT\_TEXT
* CORPDEV.GRDIVE\_DOCUMENT\_SUMMARIZE

***

### `CORPDEV.GRDIVE_INDEX(folderId)`

**Description:**\
Provides an index (like a Due Diligence document index) of documents and subfolders from a specified Google Drive folder.

**Parameters:**

* `folderId` (string): The ID of the Google Drive folder.

**Returns:**\
An index of documents and subfolders.

***

### `CORPDEV.GRDIVE_DOCUMENT_QUESTION(document_id, question)`

**Description:**\
Asks a question about a document and retrieves the answer.

**Parameters:**

* `document_id` (string): The ID of the document.
* `question` (string): The question to ask.

**Returns:**\
The answer to the question.

***

### `CORPDEV.GRDIVE_DOCUMENT_EXTRACT_FIELD(document_id, field_name, instructions, batch)`

**Description:**\
Extracts a specific field from a document.

**Parameters:**

* `document_id` (string): The ID of the document.
* `field_name` (string): The field to extract.
* `instructions` (string): Additional instructions.
* `batch` (number): Batch number.

**Returns:**\
The extracted field value.

***

### `CORPDEV.GRDIVE_DOCUMENT_EXTRACT_TEXT(document_id)`

**Description:**\
Extracts text from a specified document.

**Parameters:**

* `document_id` (string): The ID of the document.

**Returns:**\
The extracted text.

***

### `CORPDEV.GRDIVE_DOCUMENT_SUMMARIZE(document_id, instructions)`

**Description:**\
Summarizes a document and returns the summary.

**Parameters:**

* `document_id` (string): The ID of the document.
* `instructions` (string, optional): Instructions for summarization.

**Returns:**\
The summary of the document.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.corpdev.ai/corpdev.ai-docs/excel-add-in/document-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
