How to Integrate Google Apps Script & Trigger with an AppSheet App

Wow. just… wow.

I got to the point where I’m going to push the button in my app (to put the trigger word in the column then clear it) and i’m like… “it can’t be this easy.” :laughing:

Pushed the button… yup. That easy.

MAJOR kudos to @LeventK for this walkthrough/guide. A-MAZ-ING, you made it SO easy.

Thank you thank you thank you for this guide.

3 Likes

Hi everyone,

I followed the guide and below is my script. Can anyone tell me where I went wrong? Thanks :slight_smile:

/** @OnlyCurrentDoc */
function myFunction(){

}
function onChange(e) {
var spreadS = e.source;
var sheet = spreadS.getActiveSheet();
var sheetName = sheet.getName();
if(sheetName === “routes”){
var activeRange = sheet.getActiveRange();
var activeRow = activeRange.getRow();
var activeColumn = activeRange.getColumn();
var activeA1 = activeRange.getA1Notation();
var activeValue = sheet.getRange(activeRow, 4).getValue();
if(activeColumn==4){
spreadsheet.getCurrentCell().setFormula(’=transpose(split("’+activeValue+’",","))’);
}
}
}

@tvinci

function onChange(e) {
	var spreadS = e.source;
	var sheet = spreadS.getActiveSheet();
	var sheetName = sheet.getName();

	if(sheetName === “routes”){
		var activeRange = sheet.getActiveRange();
		var activeRow = activeRange.getRow();
		var activeColumn = activeRange.getColumn();
		if(activeColumn==4){
			var activeA1 = activeRange.getA1Notation();
			var activeValue = sheet.getRange(activeRow, 4).getValue();
			spreadsheet.getCurrentCell().setFormula(’=transpose(split("’+activeValue+’",","))’);
		}
	}
}

OR

function onChange(e) {
	var spreadS = e.source;
	var sheet = spreadS.getActiveSheet();
	var sheetName = sheet.getName();
	var activeRange = sheet.getActiveRange();
	var activeRow = activeRange.getRow();
	var activeColumn = activeRange.getColumn();
	
	if(sheetName === “routes” && activeColumn==4){
		var activeA1 = activeRange.getA1Notation();
		var activeValue = sheet.getRange(activeRow, 4).getValue();
		spreadsheet.getCurrentCell().setFormula(’=transpose(split("’+activeValue+’",","))’);
	}
}
2 Likes

Wow!!
Thanks a ton Levent Kulacoglu!!!
I have been searching for this since long!
Thanks again!

probably one of the top five community threads I’ve ever read here! :slight_smile:

I was working on an appsheet-to-slides output example and this post/thread was very helpful!!

3 Likes

Thanks for your appreciation @TyAlevizos. I had also a couple of scripts/webhooks which generates PDF certificates via a Google Slide template. May be in a free time I can post a thread about it.

3 Likes