Create n8n Nodes:
- Create new workflow and name it something meaningful
- Select ‘form submission’ trigger for the first node
- Create test fields ‘First Name’, ‘Last Name’, ‘Email Address’, and ‘Position’.
- Test the form to confirm that data can be submitted
- Pin the sample data so it can be used in the current workflow
- Select ‘Action in App’ for the next node
- Search for ‘Google Sheets’ and click on the icon
- Click ‘Append or update row in sheet.’
- Select ‘Create new credentials’ from the ‘Credential to connect with’ dropdown menu (or add existing connection if one exists)
- Select the ‘OAuth2 recommended’ radio button
- Make sure to save your workflow frequently
Create OAuth2 strings (credentials to be used in n8n) in Google Cloud Console :
- Create credentials in Google Cloud Console (https://cloud.google.com/). You need a Google account for this – make sure you are logged in to the Google account you want to create OAuth keys on.
- Click ‘APIs & Services’
- Click ‘OAuth Consent Screen’
- Click the ‘Clients’ link on the left navigation menu
- Click ‘Create Client +’ in the top menu
- Select ‘Web Application’ from the ‘Application Type’ dropdown menu
- Give OAuth2 a name (e.g., Connect to Sheets using n8n).
- Under ‘Authorized redirect URIs,’ copy and paste the redirect URL shown in n8n’s ‘OAuth Redirect URL’ in the OAuth2 connection string dialog box
Click the blue ‘Create’ button - Copy the OAuth2 connection strings (Client Id and Client Secret) to a safe place
- Click the ‘Audience’ link in the left-hand navigation
- Add test user email accounts (the same email account you used to create the OAuth2 connection strings)
- Important! Enable Google Drive API from (https://console.cloud.google.com/apis/api/drive.googleapis.com/), otherwise the n8n will not load the Spreadsheet documents in the n8n Google Sheets node when it comes time to choose a Document to Append or Update to.
- Important! Enable Google Sheets API from (https://console.cloud.google.com/apis/api/sheets.googleapis.com/), otherwise n8n will not load the Sheets in the n8n Google Sheets node when it comes time to choose a Sheet to update form data to.
Google credentials configuration:
- Add the Client ID and Client Secret to the fields in the ‘Connection’ dialog box
- Click the ‘Sign In With Google’ button
- Select the Google email account you used to create the OAuth2 connection
- Click the ‘Continue’ link for the ‘Google hasn’t verified this app’ pop-up window
- For the Google dialog window that popup ‘wants additional access to your Google Account, click the ‘Continue’ link
- If all went well, you will see a follow-up dialog window that the connection to n8n was successful
Google Sheets and n8n configuration and test:
- Create a new Google Sheet (https://docs.google.com/spreadsheets/) on the same Google email account you created the OAuth2 connection.
- Add the fields that were created on the form in the first trigger node
- Settings should be:
- Resource: ‘Sheets Within Documents’
- Operation: ‘Append or Update Row’
- Select the Document you created earlier in Google Sheets from the Document dropdown menu. NOTE: Make sure you enable the Google Drive API; you will get an error that the Google Drive API has not been enabled when you try to select a Document from the ‘Documents’ dropdown list.
- Select the Sheet that you created. NOTE: Make sure you enable the Google Sheets API; you will get an error that the Google Sheets API has not been enabled when you try to select a Sheet from the ‘Sheets’ dropdown list.
- For ‘Mapping Column Mode’ select ‘Manual.’
- Drag and drop the form fields you created in the form node to the Google Sheet fields.
- Make sure the ‘Email Address’ field is dragged to the ‘Column to match on’ field.
- Click the ‘Execute Step’ orange button to append the pinned submitted form data to the Excel Sheet.
- Check the Sheet to confirm the data was added/appended.
- Save your workflow (it may auto-save or it may not)
Create a filter (node 3) to filter out rows in the Google Sheet (node 2):
- Search for Filter
- Drag and drop ‘Position’ into ‘Value1’.
- Is equal 2 should be = to ‘Student’
- Test the workflow to confirm it is keeping the position where the student was selected in the form dropdown list.
Send filtered form submission (node 3) to Gmail inbox (node 4):
- Search for Gmail in the node list and select ‘Send a message.’
- For ‘credentials to connect with’, select OAuth2
- Use the same OAuth2 keys for the Gmail node
- Select which permissions to allow n8n in the Gmail dialog box.
- Confirm the connection is made in the n8n Gmail dialog box (showing in the ‘credentials to connect with’ dropdown list).
- Resource: ‘Message’, To: ’email account that you can check inbox, Subject: ‘A student’, and Message: ‘this is your student’.
- NOTE: Make sure to enable the Gmail API on the Gmail account you created the n8n workflow on (https://console.developers.google.com/apis/api/gmail.googleapis.com), else the Gmail node will not send the filtered message in the workflow
- Go to the inbox of the email account you assigned to accept messages and check that the sent message is in the inbox.

