> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newport.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing and Organizing Your Data Records in Google

> Learn how to create, organize, update, and export data records in Google, including bulk operations, filtering, and data import from external sources.

Google gives you a flexible, structured way to store and interact with your data — whether you're managing a handful of documents or millions of records across a large organization. This guide covers the full lifecycle of your data: understanding the underlying structure, creating and querying records through the UI and API, running bulk operations efficiently, and exporting data in the format that works best for your workflow.

## Data Structure

Google organizes your data in a three-level hierarchy that keeps things consistent and easy to navigate:

* **Collections** — The top-level container, roughly equivalent to a database table or a spreadsheet. Each project can have multiple collections (e.g., `customers`, `orders`, `documents`).
* **Records** — Individual rows or entries inside a collection. Each record is a distinct item with its own set of field values.
* **Fields** — The typed attributes that describe a record. Fields can be standard types (text, number, date) or custom types you define for your workspace.

Understanding this hierarchy is important because the API endpoints, filters, and export tools all follow this same structure — you always operate at the level of a specific collection.

## Creating Records

<Steps>
  <Step title="Create a Record via the UI">
    Open a project and select the collection you want to add a record to. Click **+ New Record** in the toolbar. A form panel slides in on the right — fill in the field values and click **Save Record**. The record appears immediately in the collection view.
  </Step>

  <Step title="Create a Record via the API">
    Send a `POST` request to the `/v1/data` endpoint with your record payload:

    ```bash theme={null}
    curl -X POST https://api.google.com/v1/data \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name": "My Record", "type": "document", "fields": {"status": "active"}}'
    ```

    A successful response returns `201 Created` along with the full record object including the system-generated `id` and `created_at` timestamp.
  </Step>

  <Step title="Verify the Record">
    Confirm the record was created by querying `GET /v1/data` and filtering by the `id` returned in the previous response:

    ```bash theme={null}
    curl -X GET "https://api.google.com/v1/data?id=rec_abc123" \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```

    You can also verify directly in the UI — the new record appears at the top of the collection view immediately after creation.
  </Step>
</Steps>

## Querying Records

Use query parameters on the `GET /v1/data` endpoint to filter, sort, and paginate your records. Combine multiple filters in a single request to narrow results precisely.

```bash theme={null}
curl -X GET "https://api.google.com/v1/data?type=document&status=active&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Supported query parameters include:

| Parameter       | Type     | Description                                                            |
| --------------- | -------- | ---------------------------------------------------------------------- |
| `type`          | string   | Filter by record type (e.g., `document`, `task`)                       |
| `status`        | string   | Filter by the value of the `status` field                              |
| `created_after` | ISO 8601 | Return records created after this timestamp                            |
| `sort`          | string   | Field to sort by, prefix with `-` for descending (e.g., `-created_at`) |
| `limit`         | integer  | Number of records per page (max `100`, default `20`)                   |
| `cursor`        | string   | Pagination cursor returned in the previous response                    |

<Tip>
  **Use cursor-based pagination for large datasets.** Offset-based pagination (`page=2`) becomes unreliable and slow on large collections. Google's API returns a `next_cursor` value in every paginated response — pass it as the `cursor` parameter in your next request to fetch the following page without missing or duplicating records.

  ```bash theme={null}
  # First page
  curl -X GET "https://api.google.com/v1/data?limit=100" \
    -H "Authorization: Bearer YOUR_API_KEY"

  # Response includes: { "next_cursor": "eyJpZCI6IjEyMzQ1In0=" }

  # Next page
  curl -X GET "https://api.google.com/v1/data?limit=100&cursor=eyJpZCI6IjEyMzQ1In0=" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  Continue until `next_cursor` is `null`, which signals you've reached the last page.
</Tip>

## Bulk Operations

For large-scale changes, Google's dashboard provides bulk operation tools that let you act on many records at once without writing custom scripts.

**Import from CSV**

You can import records directly from a CSV file through the dashboard. Go to your collection, click **Import → CSV**, and upload your file. Google maps column headers to field names and shows a preview of the import before you commit. You can configure whether duplicate records are skipped or updated before confirming.

<Note>
  When preparing your CSV, make sure column headers exactly match the field names in your collection. Fields that don't match are ignored during import. Download the **CSV Template** from the Import dialog to get a pre-formatted file with the correct headers.
</Note>

**Bulk Update**

To update multiple records at once in the UI, switch your collection to **Table View**, select the records you want to change using the checkboxes in the left-most column, then click **Bulk Edit** in the action bar that appears at the top. Choose the field to update, enter the new value, and confirm. All selected records are updated instantly.

Alternatively, use `POST /v1/data` in a loop from your application to create or update records programmatically, one at a time:

```bash theme={null}
curl -X POST https://api.google.com/v1/data \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated Record", "type": "document", "fields": {"status": "archived"}}'
```

**Bulk Delete**

In the Table View, select the records to remove using their checkboxes, then click **Delete Selected** in the action bar. A confirmation dialog shows the number of records that will be permanently removed.

<Warning>
  Bulk delete is **permanent and cannot be undone**. Export a backup before running large delete operations, especially in production collections.
</Warning>

## Exporting Data

Google supports exporting your records in two formats:

* **JSON** — Preserves all field types, nested objects, and metadata. Best for re-importing into Google or processing programmatically.
* **CSV** — Flat tabular format compatible with Excel, Google Sheets, and most BI tools. Custom fields are included as columns.

**Export via UI:** Open a collection, click **Export** in the toolbar, choose your format, apply any active filters, and click **Download**. Your browser downloads the file immediately.

**Fetch data programmatically:** Use `GET /v1/data` with your desired query parameters and process the JSON response in your application. Paginate through all records using the `cursor` parameter (see [Querying Records](#querying-records) above) until `next_cursor` is `null`, then write the collected results to your preferred format:

```bash theme={null}
curl -X GET "https://api.google.com/v1/data?type=document&status=active&limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Scheduled Exports**

From **Settings → Exports**, you can configure recurring exports that run automatically on a daily, weekly, or monthly cadence. Exports are delivered to a connected cloud storage bucket (Amazon S3, Google Cloud Storage, or Azure Blob) or emailed as an attachment to specified recipients.
