ToolJet has the capability to establish a connection with Google Sheet for both reading and writing data. By utilizing OAuth 2.0, ToolJet can establish a secure connection with Google Sheet, ensuring that the application's access to a user's account is restricted and limited appropriately.
<divstyle={{paddingTop:'24px'}}>
## Self-Hosted Configuration
If you decide to self-host ToolJet, there are a few additional steps you need to take:
1. Proceed with the setup steps provided in the [Google OAuth 2.0 guide](/docs/3.0.0-LTS/setup/env-vars#google-oauth--optional-) to configure the necessary settings.
2. Assign the corresponding values obtained from the previous step to the following environment variables:
- **GOOGLE_CLIENT_ID**
- **GOOGLE_CLIENT_SECRET**
- **TOOLJET_HOST**
3. Activate the Google Sheets API within the Google Cloud Platform (GCP) console.
</div>
<divstyle={{paddingTop:'24px'}}>
## Connection
To establish a connection with the Google Sheet datasource, you can either click on the **+ Add new Data source** button located on the query panel or navigate to the **[Data Sources](/docs/data-sources/overview)** page through the ToolJet dashboard.
### Authorization Scopes
When connecting to a Google Sheets datasource, you can choose between two permission scopes:
1.**Read Only**: This scope allows you to access and retrieve data from the Google Sheet.
2.**Read and Write**: This scope grants you both read and write permissions, enabling you to retrieve and modify data within the Google Sheet.
**Spreadsheet ID** can be obtained from the URL of the spreadsheet. For example, in the URL `https://docs.google.com/spreadsheets/d/1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM/edit#gid=0`, the `1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM` represents the spreadsheet ID.
This operation can be used to create a new spreadsheet.
#### Required Parameter
- **Title**
<divstyle={{textAlign:'center'}}>
<imgclassName="screenshot-full"src="/img/datasource-reference/google-sheets/create-sheet.png"alt="create a spreadsheet"style={{marginBottom:'15px'}}/>
</div>
### List All Sheets of a Spreadsheet
This operation can be used to list all sheets of a spreadsheet.
#### Required Parameter
- **Spreadsheet ID**
<divstyle={{textAlign:'center'}}>
<imgclassName="screenshot-full"src="/img/datasource-reference/google-sheets/list-all-sheets.png"alt="create a spreadsheet"style={{marginBottom:'15px'}}/>
This operation allows you to retrieve basic information about the spreadsheet, including the number of sheets, theme, time zone, format, and URL, among others.
<divstyle={{textAlign:'center'}}>
<imgclassName="screenshot-full"src="/img/datasource-reference/google-sheets/info-v2.png"alt="google sheets get info"style={{marginBottom:'15px'}}/>