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

# Creating Data Views

> Learn how to share knowledge with Data Views and Service Accounts

# Overview

Integrate your data with tools like Power BI, Tableau, and Looker by creating Data Views of your Datagrid Knowledge, enabling seamless connections and visualization without the hassle.

## Complete Implementation

Here's a complete implementation showing the full flow from creating knowledge to obtaining BigQuery connector credentials:

```python Python theme={null}
import os
from datagrid_ai import Datagrid

datagrid_client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),
)

# Step 1: Create Knowledge from file(s)
with open("./data/sales-q4.csv", "rb") as file:
    knowledge = datagrid_client.knowledge.create(
        name="Sales Data Q4",
        files=[file],
    )

# Step 2: Create a Service Account
service_account = datagrid_client.data_views.service_accounts.create(
    name="bigquery-connector",
    type="gcp",
)

# Step 3: Create a Data View linking knowledge to service account
data_view = datagrid_client.data_views.create(
    knowledge_id=knowledge.id,
    service_account_id=service_account.id,
    name="Sales Data View",
)

# Step 4: Get Service Account Credentials to view your Data Views via a BigQuery connector
credentials = datagrid_client.data_views.service_accounts.credentials(
    service_account.id
)
```

```typescript TypeScript theme={null}
import Datagrid from "datagrid-ai";
import * as fs from "fs";

const datagridClient = new Datagrid({
  apiKey: process.env["DATAGRID_API_KEY"],
});

// Step 1: Create Knowledge from file(s)
const knowledge = await datagridClient.knowledge.create({
  name: "Sales Data Q4",
  files: [fs.createReadStream("./data/sales-q4.csv")],
});

// Step 2: Create a Service Account
const serviceAccount = await datagridClient.dataViews.serviceAccounts.create({
  name: "bigquery-connector",
  type: "gcp",
});

// Step 3: Create a Data View linking knowledge to service account
const dataView = await datagridClient.dataViews.create({
  knowledge_id: knowledge.id,
  service_account_id: serviceAccount.id,
  name: "Sales Data View",
});

// Step 4: Get Service Account Credentials to view your Data Views via a BigQuery connector
const credentials = await datagridClient.dataViews.serviceAccounts.credentials(
  serviceAccount.id
);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.