Google Apps Script new Class for AppSheet to deal with data manipulations

Thanks to the recent addition of the new features, AppSheet is going to be more deeply integrated with Google Apps Script to do new bits and pieces which were NOT possible before this new features.

AppSheet is also one of the major applications in Google Workspace. So it is making perfect sense to me that we get "AppSheet Class" for Google Apps Script to control app behavior from GAS, such as data changes, fire actions etc.   AppSheet already provided the user (enterprise) with AppSheet native APIs for data control.  

For now, we need to call this API endpoint from Scrip using URLfetchApp all the time, which is tedious.

AppSheetApp class could make it far more easier by introducing new class with several methods to control the apps data from the script.

From script, just add new rows with script something like : - 

var data = [ a , b , c , d, e ]

AppSheetApp.getAppByName("xxxx").getTableByName("yyyy"), appendRow(data)

Google Apps Script is basially wrapper for APIs of Google Workspace products.  Why not adding AppSheet as a new class?

Thank you for considering.

@takuya_miyai 

@nico 

 

Status Open
11 5 653
5 Comments
nico
Staff

Yes, good idea. If we see enough adoption of Apps Script in AppSheet we will strongly consider this to make it easier to use.

We have a public API that is usable and there are SpreadsheetApp and JDBC to do CRUD operations on your data but it would be easier if we exposed a first party AppSheet-specific api.

 

Vargas
Bronze 1
Bronze 1

Hi @nico , @Koichi_Tsuji 
Taking advantage of the topic that also addresses the Appscript theme, we know that it is already possible to receive the return value in the appscript tasks.
I would like to know if there is any news for return values in fields?
I believe I saw a topic some time ago, saying that this improvement would also arrive soon. Could you confirm us about this type of return?

nico
Staff

@Vargas

> I would like to know if there is any news for return values in fields?

I'm sorry, I don't understand what you mean by "field" in this context. Do you mean a field in an object like this?

return {"fieldA": 123, "fieldB": "sample data"};

That's something that's supported in AppSheet's Apps Script return value Task today though we don't supported nested objects like `{"object": {"nestedKey": 1}}`. I think I might not be understanding correctly.


Koichi_Tsuji
Gold 4
Gold 4

@nico 

Thank you Nico for your positive feedback and comment.

Yes, we have spreadsheet and other API to mainpulate app data, however, AppSheet API is already providing all the CRUD operation.  The far more strongest point is we dont need to care where the actual app data is stored, as AppSheet is looking it after.

I have been already using this GAS/AppSheet intergration heavily.  Converting the file generated by Automation (Such as CSV) into another type (CSV but with other chara code instead of UTF8) and some more.  It works perfectly.

However, I get to know the consumption of return values has limitation. For instance, It can not accomodate the array of objects etc.   There are lots of external API which return array of objects.  One object is deemed as single row data when it comes to AppSheet.  So withtout getting return values (such as array of objects) , then we leave the task to GAS alone.  Once we get such API response body, then call "AppSheet Class" and add new records to target tables etc.  

Without doubt, AppSheet class will make such type of functionalities far more easier to set up and give us (app creators) more flexibilities.

 

Vargas
Bronze 1
Bronze 1

Hi @nico,
Sorry, I think I wasn't clear in my question.
It would be about the possibility of using custom functions with return in the fields in the appsheet, not only in tasks.
I can't find the post you commented on.
You commented something similar: "I think I got too far ahead...", "I'll need an update first (which I believe is the return of value in the tasks)...