> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/g/google-sheets-licenses.md).

# Google Sheets Licenses

Google Sheets is a spreadsheet service of Google. This adapter reads a list of licenses kept in a spreadsheet and imports each row as a license asset in OctoXLabs.

## Use cases

* Bring licenses that are tracked by hand into the same inventory as your automated sources.
* Compare the spreadsheet rows with what other adapters report to find missing or stale entries.
* Check what one Google Sheets Licenses connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination       | Port         | Protocol     |
| ------------------- | ----------------- | ------------ | ------------ |
| OctoXLabs connector | Google Sheets API | Not verified | Not verified |

The connector must reach Google APIs. If it can only reach the internet through a proxy, set the Https Proxy parameter.

### Required permissions

| Scope or role                                                          | Permission | Needed for                            |
| ---------------------------------------------------------------------- | ---------- | ------------------------------------- |
| Google Sheets API enabled in the Google Cloud project                  | Enabled    | Reading the spreadsheet               |
| Viewer access on the spreadsheet, granted to the service account email | Read       | Reading the rows of the license sheet |

No IAM role is needed. The service account reads only the spreadsheets that are shared with it. Sharing with the whole domain does not include it.

## Create credentials in Google Sheets

{% stepper %}
{% step %}

### Create a service account

Open the [Service accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts) of a Google Cloud project and create a service account.
{% endstep %}

{% step %}

### Enable the Google Sheets API

In the same project, go to **APIs & Services** > **Library** and enable the **Google Sheets API**.
{% endstep %}

{% step %}

### Share the spreadsheet

Open the spreadsheet, select **Share** and add the service account email as a **Viewer**.
{% endstep %}

{% step %}

### Create a JSON key

Open the service account, go to the **Keys** tab, select **Add key** > **Create new key**, choose **JSON** and download the file. Upload this file in the Service Account Key File parameter.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
The key file is the only copy of the private key. Store it securely and create a new key if it is lost.
{% endhint %}

## Connection parameters

| Parameter                | Required | Type    | Default    | Description                                                                                                                                                                                                                                                                                                           |
| ------------------------ | -------- | ------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Service Account Email    | Yes      | String  | None       | Email address of the Google Cloud service account. It must match the `client_email` of the key file.                                                                                                                                                                                                                  |
| Service Account Key File | Yes      | File    | None       | The JSON key file of the service account.                                                                                                                                                                                                                                                                             |
| Spreadsheet ID           | Yes      | String  | None       | The ID in the spreadsheet URL, `https://docs.google.com/spreadsheets/d/<ID>/edit`. The full URL can be pasted as well.                                                                                                                                                                                                |
| Sheet Range              | No       | String  | Sheet1     | The sheet name, or a range in A1 notation such as `Sheet1!A1:Z`, holding one license per row. The first row holds the column headers. If the first tab has another name, enter that name. Put sheet names with spaces, or names that look like a cell such as `Q1`, in single quotes, for example `'Asset List'!A:Z`. |
| Primary Key Field        | No       | String  | PrimaryKey | The column header holding the unique identifier per row.                                                                                                                                                                                                                                                              |
| List Separator           | No       | String  | `\|`       | A cell holding this character is read as a list of values, for example `10.0.0.1\|10.0.0.2`. Key columns and canonical columns holding a single value are never split. Leave it empty to keep every cell whole.                                                                                                       |
| Https Proxy              | No       | String  | None       | Proxy URL.                                                                                                                                                                                                                                                                                                            |
| Timeout                  | No       | Integer | 30         | Time in seconds to wait for API responses.                                                                                                                                                                                                                                                                            |

Required flags and types come from the frontend instructions. They were not checked against connector code.

### Column names

Name your column headers with the canonical field names below and the rows map automatically: **PrimaryKey**, **Name**, **Description**, **Status**, **Total**, **Used**, **ExpiryDate**, **PurchaseDate**. Other columns are kept as raw data.

* **Total** and **Used** are whole numbers; other values such as `unlimited` are left empty.
* **ExpiryDate** and **PurchaseDate** accept date cells in any format, or text such as `2026-10-17 09:30:00`; other values are left empty. Date cells in other columns are kept as serial numbers; format such a column as plain text to keep its text.
* Rows without a value in the key column are skipped.

## Troubleshooting

| Error message | Cause                                               | Fix                                                                                                                                                           |
| ------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Not verified  | Error texts could not be taken from connector code. | Run the connection test and check that the spreadsheet is shared with the service account email, the Google Sheets API is enabled and the Sheet Range exists. |

## Change history

{% hint style="info" %}
Available starting from version 6.9.1.
{% endhint %}
