The following custom Google sheet function fi...

(Steve Langert) #1

The following custom Google sheet function finds the author of a book from Goodreads’ website by passing the ISBN of the book to the function.

Can we do this from within Appsheet?

Is this webhooks?

function GETAUTHOR(ISBN) {

ISBN = encodeURIComponent(ISBN);

var url = ‘https://www.goodreads.com/search/index.xml?key=[MY KEY]&q=’ + ISBN;

var response = UrlFetchApp.fetch(url).getContentText();

var xml = XmlService.parse(response);

var root = xml.getRootElement();

var author = root

.getChild(‘search’)

.getChild(‘results’)

.getChild(‘work’)

.getChild(‘best_book’)

.getChild(‘author’)

.getChild(‘name’)

.getValue();

return author; }

(Bellave Jayaram) #2

You can use IMPORTHTML or IMPORTXML in Gsheets. https://support.google.com/docs/answer/3093342?hl=en&ref_topic=3105411

(Steve Langert) #3

@Bellave_Jayaram The custom function works great in Gsheets.

I do not need to replace it.

I am just trying to figure out how to bring this function (or something that accomplishes the same) into Appsheet.

(Bellave Jayaram) #4

Okay. All you have to do is put the custom function as a container bound script and you can use that function in any cell in your sheet.

You cannot access that function directly from AppSheet (I mean in an app formula).

(Steve Langert) #5

@Bellave_Jayaram I was pleasantly surprised to find that Appsheet automatically copies the function as new rows are added so it works for me now in the prototype.

For some reason, I didn’t think Appsheet worked that way.

I ultimately want to move to MySQL which may or may not have this functionality.

Can Appsheet do something like this on its own without relying on the Gsheet custom function?

(Bellave Jayaram) #6

I don’t know whether you would be able to do it with MySQL. Also, AppSheet cannot do what you want on its own yet. A good enhancement request though.

@praveen

(Steve Langert) #7

@Bellave_Jayaram I thought I saw somewhere that Appsheet will, in the near future, have the capability to take a record from one table and then append it to another.

This would be a good solution for me if it was in the form of an action the could be invoked from a workflow.

I could use the Gsheet to get info on a book using the custom function and then append the Gsheet row to the MySQL table.

Am I correct? @praveen

(Steve Langert) #8

Lastly, I would need to append values - not the formula.