Google sheet to telegram scenario not working when data coms from a webApp

Hi All,
I’m gathering data form android application to google sheet using webApp and I’m trying to send it to Telegram bot using this scenario

But there is a problem, when data get into sheet, the scenario did not sense the new row added, although when I copy some data and paste it to sheet its works fine.

The script used in the sheet is this:

function doGet(e) {
return ManageSheet(e);
}
function doPost(e) {
return ManageSheet(e);
}

function ManageSheet(e) {

//READ ALL RECORDS

if ( e.parameter.func == “ReadAll”) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
var rg = sh.getDataRange().getValues();
var outString = ‘’;
for(var row=0 ; row<rg.length ; ++row){
outString += rg[row].join(‘,’) + ‘\n’;
}
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}

//DELETE SNNGLE RECORD

else if (e.parameter.func == “Delete”) {
var record = e.parameter.id;
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
sh.deleteRow(parseInt(record) + 1);
return ContentService.createTextOutput(“true”);
}

//READ SNNGLE RECORD
else if ( e.parameter.func == “ReadRecord”) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
var rg = sh.getDataRange().getValues();
var outString = ‘’;
outString += rg[parseInt(e.parameter.id)].join(‘**’);
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}

//UPDATE SNNGLE RECORD Specify PoSNtion

else if (e.parameter.func == “UpdateSP”) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
var data = [ [ e.parameter.UpdateRecord ] ];
sh.getRange((e.parameter.CN)+(parseInt(e.parameter.id)+1)).setValues(data);
return ContentService.createTextOutput(“true”);
}

//Do not changed any parameters, because this is new script. for more information please watch this video:- https://youtu.be/dB-cfsbGbLg

//CREATE NEW RECORD
if (e.parameter.func == “Create”) {

var ss = SpreadsheetApp.getActive();

var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];

var data =[e.parameter.A, e.parameter.B, e.parameter.C, e.parameter.D, e.parameter.E, e.parameter.F, e.parameter.G, e.parameter.H, e.parameter.I, e.parameter.J, e.parameter.K, e.parameter.L, e.parameter.M, e.parameter.N, e.parameter.O, e.parameter.P,e.parameter.Q, e.parameter.R, e.parameter.S, e.parameter.T, e.parameter.U, e.parameter.V, e.parameter.W, e.parameter.X, e.parameter.Y, e.parameter.Z]; 

sh.appendRow(data);

return ContentService.createTextOutput(data);

}

}

I appreciate any help about this issue.
Thanks in advance.

Welcome to the Make community!

This is correct, and is not a bug as it is a Google Sheets limitation.

You cannot use the “Watch Changes” module for changes made by another integration.

For more information, see https://www.make.com/en/help/apps/productivity/google-sheets#watch-changes-964718

You can try using the “Watch Rows” trigger module instead.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like