---
title: "Connect Pigment with Google Cloud Storage"
slug: "connect-google-cloud-storage"
description: "Learn to connect Google Cloud Storage with Pigment to import CSV files seamlessly, enhancing your data management and analysis capabilities."
tags: ["Google Cloud Storage", "Importing Exporting Data", "Pigment Integration", "Service Account"]
updated: 2026-01-30T10:54:33Z
published: 2026-01-30T10:54:33Z
---

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

# Connect Pigment with Google Cloud Storage

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/image(15).png)

This article explains how to connect a Google Cloud Storage bucket with your Pigment Organization to load any csv files stored in that bucket into a Pigment Block.

## Overview

This process starts in Google Cloud Platform, with the creation of a service account. Next, you’ll generate a Service Account Key and grant this service account access to the bucket containing the data you want to load in pigment. Then, on Pigment side, you will create a Connection, adding the Key credentials and the bucket name. Once set up, the Google Cloud Storage connector has the added benefit of being able to choose from a fixed or most recent file.

> [!WARNING]
> **⚠️****Important**
> 
> You must have a Google Cloud Storage bucket containing the data you want to load in Pigment.
> 
> You must be owner of the Google Cloud Project containing the bucket you want to connection with.

## Setting up access

### GCP Step 1 - Creating a Service Account

Pigment uses a [**Service account**](https://cloud.google.com/iam/docs/service-accounts)****to authenticate to your GCP. For security reasons, Pigment recommends a dedicated Pigment Service account.

Follow [these steps](https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating) to create a new Service Account.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/6e097e75-74ef-46f0-ab95-6bbb2092a84c(1).png)

You just need to name the service account. (ex: `Pigment`)

You don’t need to bind any policy to the service account here (on GCP access to buckets are configured directly on Google Cloud Storage side)

### GCP Step 2 - Generate a Service Account Key

Open the Service account you just created. Go to the **Keys**section and select **Add Key**then**Create new key**and select **JSON**. This downloads a **JSON** file. You need this file to configure the Connection on Pigment.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/d5c28eb5-e81e-4756-8579-54af2d8cf049(1).png)

### GCP Step 3 - Configure bucket access

This step grants the Pigment service account access to the bucket containing the data you want to share with Pigment. The Pigment connector is compatible with both **Uniform**and **Fine-grained**[Access control](https://cloud.google.com/storage/docs/access-control) buckets.

> ℹ️ **Note**
> 
> Pigment recommend using a **dedicated bucket** for Pigment**.**On this bucket upload only the data which are meant to be loaded by Pigment. If you use a dedicated bucket,****use the **Uniform**access control****to simplify the access configuration.

[Follow those steps](https://cloud.google.com/storage/docs/access-control/using-iam-permissions#bucket-add) to add a principal to the bucket configuration.

![Adding principals and roles for the pigment-storage resource in a cloud interface.](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/comped.png)

Grant to the Service account you just created the **Storage Object Viewer** Role.

## Establishing connection in Pigment

Go to the integration page from the Settings tab.

Next click on **+ Add** next to the **Google Cloud Storage integration**.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/f6ed9523-6c5d-44f4-8eb6-6c83b25cb981.png)

Fill out the form with the following information. You will need to establish a connection for each individual GCS bucket.

| - **Name**: give a name to your connection - **Bucket name**: name of the bucket which can be accessed with this connection. (ex: `pigment-export` ) - **Credentials**: Content of the JSON file generated during service account’s Key creation (Step 2) - **Application access**: Select the applications which will be allowed to use this connection | ![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/bbbdf50b-3637-4e9f-856c-04310103121b.png) |
| --- | --- |

## Use the connection in Pigment

Once the GCS connection is configured, open an Application that the connection is available on and open the “Import Data” interface for the object you want to import data into. For example, if you were importing data into a Transactions, you would open up list and then select **Import and Download**and then**Import** .

Instead of “Upload file”, select the Integration option. From here, select your GCS connection.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/85a762cc-64bf-464e-a4cc-8cbf70eeac5e.png)

Select the **Import mode**you want.

### Fixed file

This import mode will choose one individual file name.

Just input the file name and location (ex: `folder1/folder2/file.csv`) and click on **Import**.

The file should load in Pigment within a few seconds! If this configuration is saved, it will only upload that file name.

### Most recent file

This import mode allows you to define a path and Pigment will upload the most recent file depending on a defined naming convention that must contain a [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) compatible date format within it.

**Naming convention in Google Cloud Storage**

When naming your files in Google Cloud Storage, your file name must follow a consistent naming convention with the date included. Here are some examples of file names for a rev.csv with the [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) compatible date formats.

| [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) compatible date formats | example of file names {{date}}-rev.csv naming convention |
| --- | --- |
| `yyyy-MM-dd` | 2022-09-30-rev.csv |
| `yyyy-MM-ddThh:mm:ss` | 2022-09-30T00:00:00-rev.csv |
| `yyyy-MM-ddThh:mm:ssZ` | 2022-09-30T00:00:00Z-rev.csv |

**When writing the file path in Pigment**

Similar to the Fixed file, you must first define the path with the location(ex: `folder1/folder2/ )` , then you must define file naming convention****with a date included in the file name or in the path name. When entering the case sensitive path in Pigment, use**{{date}}**where the date is located.

It should look something like this `folder1/folder2/prefix{{date}}suffix.csv` or `folder1/prefix{{date}}suffix/file.csv`

Here are some examples of file names and the results depending on what path you entered.

If the bucket contains the following files:

- /myfolderA/2022-09-15-salaries.csv
- /myfolderA/2022-10-15-salaries.csv
- /myfolderA/2022-10-16-revenue.csv
- /myfolderB/2022-11-15-salaries.csv

Here are the results I would get depending on my file path :

- path "myfolderA/{{date}}-salaries.csv" will import `/myfolderA/2022-10-15-salaries.csv` because this is the most recent file in myfolderA.
- path "myfolderB/{{date}}-salaries.csv" will import `/myfolderB/2022-11-15-salaries.csv` because this is the most recent file in myfolderB.
- path "/{{date}}-salaries.csv" will import nothing because its missing the folder location.
