> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/expert-center/faq-and-troubleshooting/iot-logic/how-to-connect-an-iot-logic-webhook-node-to-google-sheets.md).

# How to connect an IoT Logic Webhook node to Google Sheets

In this guide, you will learn how to send telematics parameters or external data source values from Navixy IoT Logic flow to Google Sheets using the Webhook node.

<img src="/files/wDoqShBiGzqgVCD5Jhxi" alt="" height="236" width="624">

## Step 1. Add the Webhook node

Once your IoT Logic flow has been created, add a Webhook node and connect it to the trigger that will initiate the data transmission.

The Webhook node works as a fire-and-forget mechanism. This means it sends the HTTP request immediately when triggered but does not wait for or store the server's response.

After adding the Webhook node, configure it as follows.

#### URL

Enter the Google Apps Script Web App URL associated with the Google Sheet where you want to send the information.

#### Headers

Add the following HTTP header:

| Key          | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

#### Body

The request body must be in JSON format. It must include the authentication key and any data you want to send to Google Sheets.

Example:

*{*

*"key": "MY\_SUPER\_SECRET\_123",*

*"event": "morning\_fuel\_report",*

*"device\_id": "{{device\_label}}",*

*"timestamp": "{{comb\_current\_time}}"*

*}*

You can include any additional IoT Logic attributes or telemetry parameters by using their corresponding placeholders.

Note: The "key" field is required if your Google Apps Script uses a shared secret to authenticate incoming webhook requests. Replace "MY\_SUPER\_SECRET\_123" with the secret configured in your Google Apps Script.

<img src="/files/bdhWhi4In0NoXw19safh" alt="" height="497" width="309">

## Step 2. Set up the Google Sheet

Open your Google Sheet, click Extensions, and then select Apps Script.

<img src="/files/7DXiHLZaK2OXgkSzznjN" alt="" height="277" width="624">

This will open the Code.gs file, where you will add the script responsible for receiving the webhook requests and writing the data into the spreadsheet.

<img src="/files/mAtyomkksxswoSXH45pA" alt="" height="249" width="624">

The following sample code can be used to receive the values sent from the Webhook node and append them as a new row in your Google Sheet.

*function doPost(e) {*

*var SECRET\_KEY = "MY\_SUPER\_SECRET\_123";*

*var data = JSON.parse(e.postData.contents);*

*if (data.key !== SECRET\_KEY) {*

*return ContentService.createTextOutput("Access Denied").setMimeType(ContentService.MimeType.TEXT);*

*}*

*var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();*

*sheet.appendRow(\[*

*new Date(),*

*data.name || "",*

*data.device\_id || "",*

*data.longitud || "",*

*data.latitud || ""*

*]);*

*return ContentService.createTextOutput("Success").setMimeType(ContentService.MimeType.TEXT);*

*}*

**Note**: Replace the sample code above with the script provided below. You may also customize the fields to match the data being sent from your IoT Logic Webhook.

The script above acts as an HTTP POST endpoint that receives requests sent from the IoT Logic Webhook node.

Whenever a request is received, the script first validates a shared secret (SECRET\_KEY) to ensure that only authorized webhook requests are allowed to write data into the Google Sheet. If the authentication is successful, the JSON payload is parsed and the specified parameters—such as the reception timestamp, device name, device ID, longitude, latitude, or any other telemetry values—are automatically appended as a new row in the spreadsheet.

Finally, the script returns a response indicating whether the operation was completed successfully (Success) or rejected due to an invalid authentication key (Access Denied).

Important: The field names used in the script must exactly match the parameter names sent by the IoT Logic Webhook. Each value is accessed using the data.\<parameter\_name> syntax, where \<parameter\_name> corresponds to the JSON property received in the request.

For example, if the webhook sends the following parameter:

*{*

*"fuel\_level": 68.5*

*}*

The Apps Script must reference it as:

*data.fuel\_level*

If the script instead references:

*data.fuel\_level\_march*

The value will not be populated because no parameter with that name exists in the incoming JSON payload. As a result, the corresponding cell in Google Sheets will remain empty.

This is one of the most common configuration mistakes when integrating the IoT Logic Webhook with Google Sheets. Always verify that the parameter names in the Webhook Body exactly match those used in the Apps Script, including capitalization, underscores, and spelling.

Once you have finished matching the JSON body with your Apps Script code, click the Deploy button.

Under Who has access, make sure to select Anyone.

This setting is required because when the Webhook node sends an HTTP POST request to the Google Apps Script Web App URL, the request is received as an anonymous client (without your Google account credentials).

If the access level is configured as:

* Only myself – Google will reject the request or require authentication.
* Anyone – Google will accept the POST request without requiring the sender to sign in.

For this reason, Anyone is the recommended access level when receiving requests from external webhook providers such as Navixy, ngrok, Postman, curl, or any other third-party HTTP client.<br>

<img src="/files/RJoqlyfCu5aGOdbs14pR" alt="" height="409" width="390">

Select New Deployment, and then choose Web App from the deployment type menu. The deployment process may take a few moments. Once it is completed, a Web App URL will be generated. Copy this URL and paste it into the URL field of the Webhook node in your IoT Logic flow. The Web App URL is the endpoint that will receive the HTTP POST requests sent by the Webhook node.

<img src="/files/deWu5nn3Sx7SMEJ6G2Yv" alt="" height="494.99999999999994" width="624">

&#x20;

<img src="/files/QQvo6emn7c0IbSe7p4eX" alt="" height="492" width="624">

#### Updating the Apps Script

If you need to modify the Apps Script later, you do not need to create a new deployment.

Instead, click Deploy → Manage Deployments, select the existing deployment, and click Edit (pencil icon). After saving and redeploying the updated version, the changes made to the script will immediately take effect while keeping the same Web App URL.

This allows you to update the script without having to modify the Webhook configuration in IoT Logic.

<img src="/files/f6IijuJkIm30fuHpz8RZ" alt="" height="613" width="624">

After completing all the steps described in this guide, the connection between IoT Logic and Google Sheets should be successfully established.

This integration provides a simple and effective way to log telemetry data, external parameters, or custom IoT Logic attributes for reporting, analysis, auditing, or integration with other Google Workspace tools.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://navixy.com/docs/expert-center/faq-and-troubleshooting/iot-logic/how-to-connect-an-iot-logic-webhook-node-to-google-sheets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
