company logo

Centro de ayuda

Ir a Stackby
Stackby BlogStackby CommunityStackby YouTube ChannelStackby Facebook GroupSign up for Free
Todos los apartadosStackby AutomationsAutomation Trigger: Webhook with Google Sheet

Automation Trigger: Webhook with Google Sheet

Bring Google sheet response directly to Stackby

Step 1: Create a Webhook in Stackby

  1. Open your Stackby workspace and go to the table where you want data to appear.

  2. Click the ⚡ Automation icon (top-right).

  3. Click “Create New Automation”.

  4. Choose “ When Webhook received” as Trigger.

  1. Click “Generate Webhook URL” and copy the URL. (This is where Google Sheets will send the data.)


Step 2: Prepare Google Sheets

  1. Open your Google Sheet with the data.

  2. Make sure the first row contains column headers (e.g., Name, Email, Message).

  3. Every new row of data will be sent to Stackby when a script runs.

Step 3: Add the Google Apps Script

In your Google Sheet, click on Extensions > Apps Script.

  1. Delete any existing code and paste the following:

    function sendToStackby() {

      const url = "YOUR_STACKBY_WEBHOOK_URL"; // Replace with your webhook URL

      const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();

      const lastRow = sheet.getLastRow();

      const rowData = sheet.getRange(lastRow, 1, 1, sheet.getLastColumn()).getValues()[0];

    const payload = {

        "Name": rowData[0],      // Update keys to match Stackby column names

        "Email": rowData[1],

        "Message": rowData[2]

      };

     const options = {

        method: "POST",

        contentType: "application/json",

        payload: JSON.stringify(payload)

      };

     UrlFetchApp.fetch(url, options);

    }

  2. Replace "YOUR_STACKBY_WEBHOOK_URL" with the URL you copied from Stackby.

  3. Update "Name", "Email", etc., to match your Stackby column names.

  4. Click Save (name the project SendToStackby or anything you like).

Step 4: Set Up an Auto Trigger

  1. To run this script every time a new row is added:

  2. In the Apps Script window, click the ⏰ Triggers icon on the left panel.

  3. Click + Add Trigger.

  4. Set it up like this:

    Function to run: sendToStackby

    Event source: From spreadsheet

    Event type: On edit or On form submit

  5. Click Save, and authorize the script if asked.

Step 5: Test the Automation

  1. Add a new row of data in Google Sheets.

  2. Open your Stackby table.

  3. You should see the new row appear automatically 🎉.

¿Te ha ayudado esta respuesta?
😞
😐
😁