{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21518,"path":"integrate-applications/integration-hub/setup-gsheets.md","title":"Set up the Google Sheet spoke","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up the Google Sheet spoke\n\nSet up an outbound integration between your ServiceNow instance and the Google Sheets by setting up a connection and credential record.\n\n## Before you begin\n\n-   Request an Integration Hub subscription.\n-   Activate the Google Sheets spoke plugin.\n-   Role required: admin.\n\n## About this task\n\nThe Google Sheets API authenticates the requests from your ServiceNow instance through an OAuth application. You must [Set up OAuth app on Google Sheets API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/setup-gsheets.md) by visiting the [https://console.developers.google.com/](https://console.developers.google.com/). The connection and credentials record contains the information the Google Sheets API must authenticate the requests from your ServiceNow instance.\n\n## Set up OAuth app on Google Sheets API\n\nSet up an OAuth application on the Google Sheets API to enable authentication of requests from your ServiceNow instance.\n\n### Before you begin\n\n-   Create a business account on [https://console.developers.google.com/](https://console.developers.google.com/)\n-   Create a domain and an email address associated with the domain. For example, www.mydomain.com and jane-admin@mydomain.com.\n\n    **Note:** You can only register one email address per domain in Google Workspace.\n\n-   Role required: admin\n\n### Procedure\n\n1.  Set up a project on the Google Workspace.\n\n    The project includes the details of the OAuth application and the Application Programming Interface \\(API\\) permissions, if applicable.\n\n    1.  Log in to [https://console.developers.google.com/](https://console.developers.google.com/) with the same domain email ID and password as mentioned in the prerequisites.\n\n    2.  Select the button.\n\n        \\[Omitted image \"google-calendar-spokes-click-create-project.png\"\\] Alt text: Project creation button on Google Workspace.\n\n    3.  Select **NEW PROJECT**.\n\n        \\[Omitted image \"google-calendar-spoke-create-project.png\"\\] Alt text: Click New Project button on Google Workspace.\n\n    4.  In the Project name\\* field, enter a unique name for the project.\n\n    5.  In the Location\\* field, select **BROWSE** to select an organization.\n\n    6.  Select **CREATE**.\n\n        The project is created.\n\n    7.  Select the button.\n\n        \\[Omitted image \"google-calendar-spokes-click-create-project.png\"\\] Alt text: Select the project.\n\n2.  Select the project that you created.\n\n    \\[Omitted image \"gsheets-select-project.png\"\\] Alt text: Project selection on Google Sheets API.\n\n3.  Enable the Google Sheets API.\n\n    1.  Click **+ENABLE APIS AND SERVICES**.\n\n        \\[Omitted image \"gsheets-enable-apis.png\"\\] Alt text: Google Sheets API Enable APIs and Services button.\n\n    2.  On the Welcome to the API Library page, enter `Google Sheets` in the search box.\n\n    3.  Press **Enter**.\n\n    4.  Select the Google Sheets API button.\n\n    5.  Select **ENABLE**.\n\n        The Google Sheets APIs are enabled on your project.\n\n4.  Create the OAuth app and credentials.\n\n    1.  Select **CREATE CREDENTIALS**.\n\n        \\[Omitted image \"google-sheets-create-creds.png\"\\] Alt text: Click Credentials button for Google Sheets API.\n\n    2.  Fill the form.\n\n<table id=\"table_rxt_zgw_5wb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nSelect an API\\*\n\n</td><td>\n\nName of the API for which you're creating the credentials.**Note:** Ensure that you select Google Sheets API.\n\n</td></tr><tr><td>\n\nWhat data will you be accessing? \\*\n\n</td><td>\n\nType of data your ServiceNow will access through the APIs.**Tip:** Select User data.\n\n</td></tr></tbody>\n</table>    3.  Click **NEXT**.\n\n    4.  Fill the form.\n\n        |Field|Description|Mandatory?|\n        |-----|-----------|----------|\n        |App name|Name of the OAuth app.|Yes|\n        |User support email|Email at which users can send queries to you about their consent.|Yes|\n        |Logo file to upload|Logo representing the OAuth app.|No|\n        |Developer contact information|Google will contact the developer of the OAuth app if there are any changes to the project.|Yes|\n\n    5.  Click **SAVE AND CONTINUE**.\n\n5.  Define the API scopes.\n\n    API scopes enable you to select specific APIs. For example, /auth/spreadsheets scope enables you to create, edit, or remove spreadsheets.\n\n    1.  Click **ADD OR REMOVE SCOPES**.\n\n    2.  Enter `Google sheets API`, as shown in the image.\n\n        \\[Omitted image \"google-sheets-search-scopes.png\"\\] Alt text: Search Google Sheets in the scopes.\n\n    3.  Select one or more scopes.\n\n    4.  Click **UPDATE**.\n\n    5.  Click **SAVE AND CONTINUE**.\n\n6.  Generate OAuth client ID.\n\n    1.  From the Application type\\* list, select `Web application`.\n\n    2.  In the Name\\* field, enter a unique name of the OAuth client.\n\n7.  Under the Authorised redirect URIs heading, click **+ ADD URI**.\n\n8.  In the URI field, enter the redirect URI in the following format: `https://instance.service-now.com/oauth_redirect.do`.\n\n9.  Click **CREATE**.\n\n    The OAuth details are generated in a JSON file.\n\n    **Tip:** Click DOWNLOAD to download the JSON file for later reference.\n\n    \\[Omitted image \"google-sheets-download-json.png\"\\] Alt text: Download button to download OAuth credentials file.\n\n10. Click **DONE**.\n\n    You've created the OAuth application on Google Workspace.\n\n\n## Create Connection and Credential record for Google Sheets spoke\n\nCreate a connection and credential record that contains the details required to connect to the Google Sheets Application Programming Interfaces \\(API\\) on the Google Workspace.\n\n### Before you begin\n\n-   Create an OAuth application for the Google Sheets APIs in the Google Workspace. To learn how to create an OAuth application, see [Set up OAuth app on Google Sheets API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/setup-gsheets.md).\n-   Role required: admin\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Process Automation** &gt; **Flow Designer**.\n\n2.  Click Connections.\n\n3.  In the Search all connections field, enter `Google sheets`.\\[Omitted image \"google-sheets-search-conn.png\"\\] Alt text: Search Google Sheets alias on Flow Designer alias.\n\n4.  On the GoogleSheets card, click **View Details**.\n\n5.  Click **Configure**, as shown in the image.\\[Omitted image \"google-sheets-click-configure.png\"\\] Alt text: Configure button on Google Sheets alias.\n\n6.  Fill the form.\n\n<table id=\"table_vyw_bk4_3mb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nConnection Name\n\n</td><td>\n\nName of the connection.**Note:** The field is read-only.\n\n</td></tr><tr><td>\n\nConnection URL\n\n</td><td>\n\nThe URL used for connecting to Google Sheets APIs. This field is automatically set to `https://sheets.googleapis.com/v4/spreadsheets`\n\n</td></tr><tr><td>\n\nCredential Name\n\n</td><td>\n\nName of the credential. This field is automatically set to `Google Sheets Spoke Credential`.\n\n</td></tr><tr><td>\n\nOAuth Entity Name\n\n</td><td>\n\nName of the OAuth entity profile. This field is automatically set to `Google Sheets Spoke OAuth`.\n\n</td></tr><tr><td>\n\nOAuth Client ID\n\n</td><td>\n\nClient ID of the Google Sheets application you registered in G Suite.\n\n</td></tr><tr><td>\n\nOAuth Client Secret\n\n</td><td>\n\nClient Secret generated when you registered the application in Google API Console.\n\n</td></tr><tr><td>\n\nOAuth Redirect URL\n\n</td><td>\n\nThe redirect URL. The format of the URL is `https://<your-instance>.service-now.com/oauth_redirect.do`\n\n</td></tr></tbody>\n</table>7.  Click **Create and Get OAuth Token**.\n\n\n"}}