Register the Google Drive application in your ServiceNow instance to enable OAuth authorization for exporting table records directly to Google Sheets.

Before you begin

Role required: admin

About this task

An Application Registry is a record that defines how your ServiceNow instance can connect to an external application, such as Google Sheets, using OAuth.

It includes the following information:
  • Client ID and Client Secret: Credentials for the external application.
  • Authorization and Token URLs: Web addresses used to log in and get access.
  • Redirect URL: Where the OAuth server sends the user after authorization.
  • Scopes and Profiles: Define what areas of ServiceNow the external application is allowed to access.

Procedure

  1. Navigate to All > System OAuth > Application Registry.
  2. Select New.
  3. From the list of OAuth application types, select  Connect to a third party OAuth Provider.
  4. On the form, fill in the fields.
    Table 1. Application Registries form
    Field Description
    Name Name to uniquely identify the record. For example, Sheets Integration.
    Client ID Client ID of the Google Drive application that you registered in Google Workspace.

    You can find the Google Client ID in the downloaded OAuth credentials JSON file. For more information, see Set up the OAuth application on the Google Sheets API.

    Client Secret Client secret that was generated when you registered the app in Google API Console.

    You can find the Google client secret in the downloaded OAuth credentials JSON file. For more information, see Set up the OAuth application on the Google Sheets API.

    OAuth API Script Script to customize the request and response. For example, OAuthGoogleSheetExport.
    Default Grant Type Grant type that was used to establish the token.
    Authorization URL URL that the OAuth application at Google provides to seek authorization to access the Google resource server. The URL format that you enter includes the tenant ID of your app: https://accounts.google.com/oauth2/v2.0/{API version}/authorize.

    You can find the Authorization URL in the downloaded OAuth credentials JSON file. For more information, see Set up the OAuth application on the Google Sheets API.

    Token URL URL to obtain the access token. The format that you enter for the URL is {yourgoogleaccount}.com/oauth2/{API version}/token.
    Redirect URL Redirect URL that includes the instance URL with the format https://<your-instance>.service-now.com/oauth_redirect.do.

    Update the <instanceURL> value with your instance URL.

    Token Revocation URL URL that is provided by the OAuth authorization server that enables a client application to request the revocation or cancellation of access tokens and refresh tokens that were previously issued. The format is https://{yourgoogleaccount}.com/{API version}/oauth2/revoke
  5. Select Submit.
  6. On the Application Registries page, search and select the application registry that you created.
  7. In the OAuth Entity Scopes related list, enter https://www.googleapis.com/auth/drive.file in the Name and OAuth scope fields.
    OAuth Entity Scopes related list displays the Name and OAuth scope fields to define the OAuth scope for this OAuth provider.
  8. In the OAuth Entity Profiles related list, select Sheets Integration default_profile.
  9. In the OAuth Entity Profile Scopes related list, enter https://www.googleapis.com/auth/drive.file in the OAuth Entity Scope field.
    OAuth Entity Profile Scopes related list displays the OAuth Entity scope field to define the OAuth scope that is associated with this profile.
  10. Select Update.