Step-By-Step Implementation Walk Through:

Step 3: Setting Up Google Sheets Integration with n8n

  1. Create a project in Google Cloud by visiting https://cloud.google.com/

  1. Select your project from the dropdown menu

  1. Navigate to APIs & Services (you can use the "Search" feature to find it)

  1. Click "+ Enable APIs and services" and search for "Google Sheets API"

  1. Click "Enable" to activate the Google Sheets API

  1. Click "Create credentials"

  1. Choose "User data" and click "Next"

  1. Enter your App name, User support email, and Email address for developer contact information. Then click "Save and continue"

  1. Click "Add or remove scopes"

  1. Select "All" option and then click "Update"

  1. Click "Save and continue"

  1. For Application type, select "Web application." Name it "Web client 1" and add "http://localhost:5678/rest/oauth2-credential/callback" as the Authorized redirect URI. Then click "Create."

  1. Click "Download" to save your credentials as a JSON file for later use, then click "Done"

  1. Search for "Google Auth Platform"

  1. Select "Audience" menu, click "Add users," enter your email account that will use Google Sheets, and click "Save"

  1. Select the "Client" menu and choose "Web client 1." You will then see the Client ID and Client Secret, which you can copy for adding a new credential configuration in n8n.

  1. Example of the credential screen when adding a new Google Sheets OAuth2 API connection in n8n

  1. Log in to the Gmail account you defined as the test user and create a Google Sheet

  1. Create a Google Sheet, name it "MedicationRefillRequest," and add the following list as columns A through M

  • SubmittedAt

  • DisplayName

  • Email

  • DateOfBirth

  • HospitalNumber

  • Medication

  • VerifiedGender

  • GenericName

  • Strength

  • Form

  • UseType

  • TherapeuticClass

  • IsControlledSubstance

  1. Navigate to the URL of your Google Sheet and copy the Spreadsheet ID for later use in n8n. In this example screen, the Spreadsheet ID is "1f-NohtNQFoRb3fCWHP6B6aiQEN1L1ILTbrsHKzAr6Sc"

  1. Example of the Google Sheets node when adding a new Google Sheets connection in n8n