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

# Google Sheets

> Combine the power of a modern spreadsheet tool with Enhanza to gain super powers.

<Info>
  Before you begin, [create a workspace](https://app.enhanza.com/register) and complete the onboarding.
</Info>

## Connect to Enhanza

1. Start by [creating a new Google Sheet](https://sheets.google.com/create).
2. Make sure you are logged in with a Google account that exist as [user](https://app.enhanza.com/settings/workspace/members) or has [data access](https://app.enhanza.com/settings/workspace/data-access).
3. Navigate the menu to `Data` > `Data connectors` > `Connect to Bigquery`.
4. Choose project `enhanza`.
5. Click directly on `Saved queries and query editor`, the view to access any data.
6. Now you can choose one of these option:
   * Write custom queries - for data analysts.
   * Let Enhanza help you write them - for busy people.
   * start with our prepared views - easy to get started.

### Write custom query

1. Use [Bigquery Studio](https://console.cloud.google.com/bigquery) to compose your query.
2. Paste it into you the dialogue box in Google Sheets.

### Let Enhanza help you

Reach out to [support@enhanza.com](mailto:support@enhanza.com) for help.

### Use prepared views

1. Paste the below query in the dialogue box in Google Sheets.
2. Replace `[schema_type]` with one of these:
   * `fortnox_flat`  for standard tables like `vouchers`, `invoices` etc.
   * `fortnox_reports` for more purpose built views like `balance_report`.
   * `custom` for custom views that Enhanza has built for you.
3. Replace `[workspaceId]` with your unique [workspaceId](https://app.enhanza.com/settings/workspace).

```googlesql lines theme={null}
SELECT
  CASE
    WHEN table_schema LIKE "%_flat_%" THEN "flat"
    WHEN table_schema LIKE "%_reports_%" THEN "reports"
    ELSE table_schema
    END AS schema_type,
  table_name,
  'SELECT * FROM `' || table_catalog || '.' || table_schema || '.' || table_name
    || '`' AS query,
FROM `enhanza`.`[schema_type]_[workspaceId]`.INFORMATION_SCHEMA.TABLES
ORDER BY table_name;
```

4. From the result:
   1. select you `table_name`,
   2. copy that query and
   3. start over from the top and paste the query in the dialogue box.

<Tip>
  If you're not used to working with database queries, let us assist us via [support@enhanza.com](mailto:support@enhanza.com).
</Tip>

## Video tutorial

Once connected, learn the power of using Google Sheets with Enhanza (via Google Bigquery).

<iframe width="560" height="315" src="https://www.youtube.com/embed/rkimIhnLKGI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
