Skip to Content
TutorialFeature ModulesAirtable & Google Sheets Integration

Airtable & Google Sheets Integration

Demo Project

Introduction

  • Goal: Let AI Copilot connect your Momen project to a third-party API, then check that the data really reached the other service.
  • Use Cases: Reading and writing data in an Airtable base or Google Sheet you already use, for example to sync it with your Momen app, migrate its data into Momen, or let your app update a sheet your team works in.
  • Core Logic: Describe your requirement to AI Copilot → AI Copilot builds the APIs and an Actionflow → Call API (write) → Call API (read back) → Condition (compare Task and Status, Throw on mismatch) → you find the test value in the outside service.

This guide has two parts. Part 1 connects Airtable. Part 2 connects Google Sheets. It is a minimal demo, so adapt the tables, fields and values to your own needs. The Actionflow is not connected to a page yet. Trigger it from a button or another Actionflow when you need it.

Part 1: Airtable

Prepare Airtable

  1. Create a base and a table that fit your needs. This demo uses a table named Tasks with two text fields: Task and Status.

  2. Create a personal access token at https://airtable.com/create/tokens . Give it the scopes data.records:read and data.records:write, and grant it access to your base.

  3. In Momen, open Settings → Secret and add a secret named airtable_pat. Paste the token as its value, then select Sync changes.

Never paste the secret value into the chat with AI Copilot.

Ask AI Copilot

Open AI Copilot and send the message below.

Build an API integration that adds one task record to an Airtable table. The Airtable access token is stored in the Momen secret "airtable_pat". Requirements: 1. Make these inputs: Base ID, Table ID, Task (text), and Status (text). 2. Use Momen's built-in nodes first. Use a Run code node only if no built-in node can do the step, and tell me why. 3. Save the HTTP 200 response structure of each Airtable API call, so later steps can read its fields directly. 4. After creating the record, read it back by its ID. Check that Task and Status match what was sent. Report success only if both match. 5. When you finish, delete any temporary test APIs and Actionflows, and list what you kept. Test run values: - Base ID: <YOUR_BASE_ID> - Table ID: <YOUR_TABLE_ID> - Task: "Airtable Test" followed by a random suffix you generate. Tell me the full value. - Status: Done
  • Base ID and Table ID: open your table in Airtable. The address looks like https://airtable.com/<Base ID>/<Table ID>/<View ID>. The Base ID starts with app and the Table ID starts with tbl.
  • Inputs and fields: requirement 1 lists the inputs, and the test values use the fields Task and Status. Replace them with your own inputs and field names, in both places.
  • Random suffix: AI Copilot generates it and reports it back, so you can search for it later.

What AI Copilot builds

In our run, AI Copilot created two APIs and one Actionflow. Names and structure may differ in your project, so check the request method and address, how the token is sent, the saved response structure, and the comparison step.

  • Airtable Create Task: a POST request to https://api.airtable.com/v0/{baseId}/{tableId}. The Authorization header uses the airtable_pat secret.

  • Airtable Read Task: a GET request for one record by its ID.

  • Create and Verify Airtable Task: calls both APIs, then compares the Task and Status you sent with the ones Airtable returns. If they differ, the Actionflow stops with an error. If they match, it returns Verified.

In our final project, the Actionflow takes three inputs: baseId, tableId, and one object task_fields that holds Task and Status. See the tip below for why.

Both APIs save the HTTP 200 response structure, so the Actionflow reads fields such as id and fields.Task without extra work.

To compare the request with the official reference, see Airtable Web API: Create records .

Tip: If AI Copilot adds a Run code node

AI Copilot may build the nested request body in a Run code node. If you see one, ask it to remove the node:

Remove the Run code node and build the request body with data bindings only. If that is not possible, stop and tell me which step blocks it and why.

If it reports that it cannot bind the nested fields, ask it to define the nested object as a custom type, and pass it in as one input.

In that case the Actionflow takes one object input, task_fields, that holds your fields (Task and Status in this demo), instead of separate text inputs.

Verify

  1. AI Copilot runs the test during the build. Ask it for the suffix it generated.
  2. Open your Airtable table and search for that suffix.
  3. Confirm that the record exists.

⚠️

The test writes a real record to Airtable. Debug runs roll back Momen data, but they do not undo calls to an outside service. Delete the test record when you are done.

Part 2: Google Sheets

Prepare Google Sheets

  1. Create a Google Sheet that fits your needs. This demo uses a sheet tab named Tasks with two headers in row 1: Task in A1 and Status in B1.

  2. Open the Google Cloud console , create a project, and enable the Google Sheets API for it.

  3. Configure the OAuth consent screen. Add your own Google account as a test user, and add the scope https://www.googleapis.com/auth/spreadsheets.

  4. Create an OAuth client ID of type Web application. Add https://developers.google.com/oauthplayground as an authorized redirect URI. Copy the client ID and the client secret.

  5. Open the OAuth 2.0 Playground . In its settings, select Use your own OAuth credentials, enter your client ID and client secret, and make sure Access type is Offline. Authorize the Google Sheets scope above, then select Exchange authorization code for tokens and copy the refresh token.

  6. In Momen, open Settings → Secret and add three secrets: client_id, client_secret and refresh_token. Paste the matching values, then select Sync changes.

⚠️

While the consent screen is in Testing status, Google expires the refresh token after 7 days. When it expires, repeat step 5 and update the refresh_token secret. To avoid this, set the publishing status to In production. The spreadsheets scope is sensitive, so Google shows an unverified-app warning until the app passes verification. As with Airtable, never paste these values into the chat with AI Copilot.

Ask AI Copilot

Open AI Copilot and send the message below.

Build an API integration that appends one task row to a Google Sheet. The Google credentials are stored in the Momen secrets "client_id", "client_secret" and "refresh_token". Requirements: 1. Make these inputs: Spreadsheet ID, Sheet Name, Task (text), and Status (text). 2. Use Momen's built-in nodes first. Use a Run code node only if no built-in node can do the step, and tell me why. 3. Exchange the refresh token for an access token in its own API. 4. When you append the row, set the query parameter insertDataOption=INSERT_ROWS, so existing data is never overwritten. 5. Save the HTTP 200 response structure of the token exchange, the append call and the read call. 6. After appending, read back only the row given by the updatedRange of the append call. Check that Task and Status match what was sent. Report success only if both match. 7. When you finish, delete any temporary test APIs and Actionflows, and list what you kept. Test run values: - Spreadsheet ID: <YOUR_SPREADSHEET_ID> - Sheet Name: <YOUR_SHEET_NAME> - Task: "Google Test" followed by a random suffix you generate. Tell me the full value. - Status: Done
  • Spreadsheet ID: open your sheet in Google Sheets. The address looks like https://docs.google.com/spreadsheets/d/<Spreadsheet ID>/edit. Copy the part between /d/ and /edit.
  • Sheet Name: the name of the tab at the bottom of the sheet, such as Tasks.
  • Inputs and fields: requirement 1 lists the inputs, and the test values use the fields Task and Status. Replace them with your own inputs and field names, in both places.
  • insertDataOption=INSERT_ROWS: this makes Google Sheets insert the new data as new rows below the existing data. Without it, the default mode can overwrite cells below the table.
  • Random suffix: AI Copilot generates it and reports it back, so you can search for it later.

What AI Copilot builds

In our run, AI Copilot created three APIs and one Actionflow. Names and structure may differ in your project, so check the request methods and addresses, how the token is sent, the saved response structures, and the comparison step.

  • Google OAuth Refresh Token Exchange: a POST request to https://oauth2.googleapis.com/token. The form body takes client_id, client_secret and refresh_token from your three secrets, and sets grant_type to refresh_token. It returns a short-lived access token.

  • Append Task Row to Google Sheets: a POST request to the Sheets values endpoint, with valueInputOption=RAW and insertDataOption=INSERT_ROWS. The new row goes below your existing data and never overwrites it.

  • Read Appended Google Sheets Row: a GET request that reads the range reported by the append call, which is the row it just wrote.

  • Append and Verify Google Sheets Task: exchanges the token, appends the row, reads it back and compares Task and Status with what you sent. If they differ, the Actionflow stops with an error.

In our final project, the Actionflow takes four text inputs: spreadsheet_id, sheet_name, task and status. Each API saves the HTTP 200 response structure, so later steps read fields such as updates.updatedRange directly.

To compare the requests with the official reference, see Google Sheets API: spreadsheets.values.append .

Verify

  1. AI Copilot runs the test during the build. Ask it for the suffix it generated.
  2. Open your Google Sheet and search for that suffix.
  3. Confirm that the new row is below your existing data.

⚠️

The test appends a real row to your sheet. Debug runs roll back Momen data, but they do not undo calls to an outside service. Delete the test row when you are done.

Tip: If your sheet has more than two columns

The append range in this demo is A:B, so it only fits a sheet with two columns. If your sheet has more, ask AI Copilot to extend the range and the row values.

Last updated on