Http integration in v3

Hey, I was using http integration in v2 to add sensor data to a google spreadsheet. I can’t find this option in v3. Can it be done with webhooks? Pls provide more info on how it can be done
Thanks,
Hassan

v2 HTTP Integration = v3 WebHooks

I am having trouble setting up the webhook. I set the base url as the webapp link for the google sheet. As i want to post sensor data in the google sheet, i enabled the uplink message. However, nothing is getting posted in the google sheet.

There wasn’t an HTTP Integration in v2 for that and there isn’t one in v3 either.

A WebHook sends a web request to a server with the information in JSON format - if you send it to a Google Sheet you’ll need to write some code to process the JSON.

Thanks for your replies. Please note that i had everything working properly in v2 and i am unable to recreate it in v3. I added a screenshot of the configuration i used in v2.

The part of the google sheet webapp script that adds the payload to the sheet:

// push name
var raw = Utilities.base64Decode(jsonData.payload_raw);
var decoded = Utilities.newBlob(raw).getDataAsString();
row.push(decoded);

Does this need to be changed? add_http

There is a big change in the format of the JSON but without knowing what the whole script is it will be a bit hard to comment.

I did have such a script for an integration but that was on v2 so anything I’ve got will need updating.

Here the reference on the updated JSON format in V3.
Data Formats | The Things Stack for LoRaWAN (thethingsindustries.com)

I am using this app script for the google sheet: lora_project_mkrwan1310/mkrwan1310_proj.gs at main · Mouser-Electronics/lora_project_mkrwan1310 · GitHub

I’m on mobile internet until Saturday, I can see a use for this for many of us in the near future is if you hang on, I can update it for the new format.

hello, is there an update on this? I’m running into the same issue. The data is not being passed from the TTN backend to the google sheets. thanks

I’ve not had an evening to have a go at this but it is on the reminder list.

[I’m a forum member too, not paid staff]

Here’s an updated / tidied script for the Google Sheet:

var SHEET_NAME = "Sheet1";

function doGet(e){
  return HtmlService.createHtmlOutput("Google Sheets Webhook v0.1");
}

function doPost(e){

  var theJSON = JSON.parse(e.postData.contents);

  var theSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME);

  var data = [];
  
  var theDate = Utilities.formatDate(new Date(), 'GMT-0', 'dd/MM/yyyy HH:mm:ss');
  data.push(theDate);

  data.push(theJSON.uplink_message.f_port);
  data.push(theJSON.uplink_message.f_cnt);
  data.push(theJSON.uplink_message.frm_payload);

  var decoded = Utilities.base64Decode(theJSON.uplink_message.frm_payload);
  var bytesToHex = decoded.reduce(function(str, chr) {
    chr = (chr < 0 ? chr + 256 : chr).toString(16);
    return str + (chr.length==1?'0':'') + chr;
  },''); 
  data.push(bytesToHex);

  theSheet.appendRow(data);

}

To add other fields from the JSON payload, add more data.push lines. You can re-arrange them to suit your needs with the columns. The TTS docs has examples of the JSON message.