Help on making a hook with gSheet and bubble

I want to make a webhook for “POST” to bubble.is platform.

When google sheet add on row, POST the data to bubble.is – What i want to achieve, any one can help

this workflow will be a good starting point:

There is not yet a google sheet trigger so you need to use a cron node to periodically read the google sheet. And there is no bubble.is node, so you need to use the http node. Good luck

1 Like

@forgoz any update ? I am working on it right now

@mumudu22 @svenjanssen there no Google Sheets trigger yet, but in the meantime, something like explained here can do work.

1 Like

Thanks for the reply.

I am not into the “triggering” of the data, but just passing all the data from a Google Sheet to the Bubble database.
I think I can achieve that via a POST request in an HTTP node

I managed it via the Google Sheet read node and a simple HTTP Post request (do not forget to enable the API on Bubble and create a dedicated workflow).

Thanks n8n !

Great that it worked. Let’s know if you have any other question.

Now that I moved forward I do :wink:

I am now trying the opposite : send data from Bubble to Google sheet.

I assume that I have to send a POST request from Bubble to … somewhere so that it triggers the action in n8n and sends it to Google sheet.

1 - what should be the n8n URL to send the POST request to? (it shouldn’t be a GET request from n8n as Bubble is triggering the action)
2 - what node / action to implement so that n8n is aware that Bubble is sending data?

Thanks !

You gotta use the webhook node. When you add it to the workflow and open it you are gonna see two URLs. Test and production. Copy it the URL and that is the one you are gonna paste on Bubble.

This tutorial might be helpful to understand how the webhook node works.

1 Like

:clap: thanks, I managed to use the webhook, change the URL (I previously ran n8n without the tunnel), transfer the data and update it in the Google Sheet !

Thanks a lot

ahh glad that it worked. @mumudu22

Hello Ricardo,

Hope you are doing fine. I moved forward in my workflow.

The webhook is live and gets the data from Bubble but … I want to update all the rows of the Google Sheet based on one data sent via the Webhook. When creating the workflow, the data is updated but only on the first row.
How can I make n8n understand that the one data that the webhook is sending should be used in every row ?

Regards

My workflow :


In the Set node I am setting the appropriate columns of the Google Sheet to the value sent by the Webhook

Hope you are doing fine as well.

can you please share the workflow with me? and also give an example of the data the webhook node is receiving, so that I can have a proper look.

Here is my workflow :

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "specificpath",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        100,
        150
      ]
    },
    {
      "parameters": {
        "values": {
          "number": [
            {
              "name": "price_min",
              "value": "={{$node[\"Webhook\"].json[\"body\"][\"price_min\"]}}"
            },
            {
              "name": "price_max",
              "value": "={{$node[\"Webhook\"].json[\"body\"][\"price_max\"]}}"
            },
            {
              "name": "ID",
              "value": "={{$node[\"1 - Read Google Sheet\"].json[\"ID\"]}}"
            }
          ],
          "string": [
            {
              "name": "style",
              "value": "={{$node[\"Webhook\"].json[\"body\"][\"style\"]}}"
            },
            {
              "name": "genre",
              "value": "={{$node[\"Webhook\"].json[\"body\"][\"genre\"]}}"
            },
            {
              "name": "user_id",
              "value": "={{$node[\"Webhook\"].json[\"body\"][\"user_id\"]}}"
            },
            {
              "name": "id_user_watch",
              "value": "={{$node[\"Webhook\"].json[\"body\"][\"user_id\"]}}_{{$node[\"1 - Read Google Sheet\"].json[\"ID\"]}}"
            }
          ],
          "boolean": []
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        450,
        150
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "update",
        "sheetId": *hidden*,
        "range": "A:Z",
        "key": "ID",
        "options": {
          "valueInputMode": "USER_ENTERED",
          "valueRenderMode": "UNFORMATTED_VALUE"
        }
      },
      "name": "Update data Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        620,
        150
      ],
      "credentials": {
        "googleSheetsOAuth2Api": "n8n bubble"
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "sheetId": *hidden*,
        "range": "A:Z",
        "options": {
          "valueRenderMode": "UNFORMATTED_VALUE"
        }
      },
      "name": "1 - Read Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        270,
        150
      ],
      "credentials": {
        "googleSheetsOAuth2Api": "n8n bubble"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "1 - Read Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Update data Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1 - Read Google Sheet": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

The values sent are :

  • price_min (integer)
  • price_max (integer)
  • user_id (string)
  • style (string)
  • genre (string)

And this is what the Webhook is receiving :

I think that my problem could be solved with an expression looking always for the first value in the Webhook node answer.

Something like {{$node[“Webhook”].json[“body”][“genre”].data[“0”]}} in the Set node.

Something popped into my head and I figured out something with a Function node :

for (let i=0;i<19;i++){
  items[i].json.user_id = $evaluateExpression($node["Webhook"].json["body"]["user_id"],1);
  items[i].json.style = $evaluateExpression($node["Webhook"].json["body"]["style"],1);
  items[i].json.genre = $evaluateExpression($node["Webhook"].json["body"]["genre"],1);
  items[i].json.price_min = $evaluateExpression($node["Webhook"].json["body"]["price_min"],1);
  items[i].json.price_max = $evaluateExpression($node["Webhook"].json["body"]["price_max"],1);
}
return items;

And a FunctionItem node :

item.id_user_watch = $evaluateExpression($node["1 - Read Google Sheet"].json["user_id"]) + "_" +$evaluateExpression($node["1 - Read Google Sheet"].json["id_watch"]);
return item;

It is working fine :slight_smile: if you find something easier do not hesitate to tell me !

Thanks to the team, your prompt reply and dedication