# DataShapeElement

Represents a single variable to be extracted from a document.

```ts
type DataShapeElement = {
  name: string;
  type: 'string' | 'number' | 'boolean';
  description?: string;
  isArray?: boolean;
} | {
  name: string;
  type: 'object';
  description?: string;
  isArray?: boolean;
  elements: DataShapeElement[];
};
```

* **`name`** (string): The name of the variable you want to extract.
* **`type`** ('string' | 'number' | 'boolean' | 'object'): The data type of the variable.
* **`description`** (string, optional): A brief description of the variable.
* **`isArray`** (boolean, optional): Indicates if the variable should be treated as an array.
* **`elements`** (DataShapeElement\[], required if `type` is 'object'): An array of elements describing the shape of the object.

### Notes on the `description`

We want to note that the **description** is optional but can greatly improve the result. It is used to give our AI a hint as to what you mean by the field that you want to extract.

#### Example

Let's say you name your field `first_name` within an E-Mail conversation. Without any further explanation, it might not be clear whether the recipient's or the sender's first name should be returned.


---

# 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.waveline.ai/extract/types/datashapeelement.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.
